Merge branch 'master' into renovate/monthly-updates-by-name

This commit is contained in:
Viktor Szakats 2025-11-17 15:56:58 +01:00 committed by GitHub
commit 43463df48a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
446 changed files with 1731 additions and 3318 deletions

View file

@ -38,28 +38,16 @@ commands:
steps:
- run:
command: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update && sudo apt-get install -y libssh-dev
install-deps:
steps:
- run:
command: |
sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip libpsl-dev
sudo python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
install-wolfssl:
steps:
- run:
command: |
# renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
WOLFSSL_VERSION=5.8.0
echo "Installing wolfSSL $WOLFSSL_VERSION"
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/wolfSSL/wolfssl/archive/v$WOLFSSL_VERSION-stable.tar.gz" | tar -xz
cd wolfssl-$WOLFSSL_VERSION-stable
./autogen.sh
./configure --disable-dependency-tracking --enable-tls13 --enable-all --enable-harden --prefix=$HOME/wssl
make install
sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
configure:
steps:
@ -109,16 +97,24 @@ commands:
build:
steps:
- run: make -j3 V=1
- run: src/curl --disable --version
- run: make -j3 V=1 examples
test:
steps:
- run: make -j3 V=1 test-ci TFLAGS='-j14'
- run:
command: |
source ~/venv/bin/activate
# Revert a CircleCI-specific local setting that makes test 1459
# return 67 (CURLE_LOGIN_DENIED) instead of the
# expected 60 (CURLE_PEER_FAILED_VERIFICATION).
echo 'StrictHostKeyChecking yes' >> ~/.ssh/config
make -j3 V=1 test-ci TFLAGS='-j14'
executors:
ubuntu:
machine:
image: ubuntu-2004:2024.01.1
image: ubuntu-2204:2025.09.1
jobs:
basic:
@ -161,7 +157,7 @@ jobs:
arm:
machine:
image: ubuntu-2004:2024.01.1
image: ubuntu-2204:2025.09.1
resource_class: arm.medium
steps:
- checkout
@ -172,7 +168,7 @@ jobs:
arm-cares:
machine:
image: ubuntu-2004:2024.01.1
image: ubuntu-2204:2025.09.1
resource_class: arm.medium
steps:
- checkout

View file

@ -20,7 +20,12 @@ use warnings;
my @whitelist;
my %alt;
my %exactcase;
my $skip_indented = 1;
if($ARGV[0] eq "-a") {
shift @ARGV;
$skip_indented = 0;
}
my %wl;
if($ARGV[0] eq "-w") {
shift @ARGV;
@ -68,7 +73,7 @@ sub file {
my $in = $_;
$l++;
chomp $in;
if($in =~ /^ /) {
if($skip_indented && $in =~ /^ /) {
next;
}
# remove the link part
@ -94,7 +99,7 @@ sub file {
}
print STDERR "$f:$l:$c: error: found bad word \"$w\"\n";
printf STDERR " %4d | $in\n", $l;
printf STDERR " %4d | %s\n", $l, $in;
printf STDERR " | %*s^%s\n", length($p), " ",
"~" x (length($w)-1);
printf STDERR " maybe use \"%s\" instead?\n", $alt{$w};

View file

@ -10,59 +10,56 @@ tool chain:toolchain
tool-chain:toolchain
wild-card:wildcard
wild card:wildcard
\bit's:it is
aren't:are not
can't:cannot
could've:could have
couldn't:could not
didn't:did not
doesn't:does not
don't=do not
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
isn't:is not
it'd:it would
should've:should have
that's:that is
there's:there is
they'd:They would
you've:you have
they'll:They will
they're:They are
they've:They have
we'd:we would
we'll:we will
we're:we are
we've:we have
won't:will not
you'd:you would
you'll:you will
you're:you are
should've:should have
don't=do not
could've:could have
doesn't:does not
isn't:is not
aren't:are not
you've:you have
a html: an html
a http: an http
a ftp: an ftp
a IPv4: an IPv4
a IPv6: an IPv6
url =URL
url [^=]=URL
[^/]internet\b=Internet
isation:ization
\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
dir [^=]=directory
Dir [^=]=Directory
sub-director:subdirector
you'd:you would
you'll:you will
can't:cannot
that's:that is
web page:webpage
host name\b:hostname
host names\b:hostnames
[^;]file name\b:filename
[^;<]file name\b:filename
file names\b:filenames
\buser name\b:username
\buser names\b:usernames
\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
@ -78,5 +75,5 @@ couldn't:could not
---WWW::Curl
---NET::Curl
---Curl Corporation
\bmanpages[^./&:-]:man pages
\bmanpage[^si./&:-]:man page
\bmanpages[^./;=&{:-]:man pages
\bmanpage[^si./;=&{:-]:man page

View file

@ -14,6 +14,7 @@ name: 'Docs'
- '*/ci'
paths:
- '.github/workflows/checkdocs.yml'
- '.github/scripts/**'
- '.github/scripts/mdlinkcheck'
- '/scripts/**'
- '**.md'
@ -25,6 +26,7 @@ name: 'Docs'
- '.github/workflows/checkdocs.yml'
- '.github/scripts/**'
- '.github/scripts/mdlinkcheck'
- '/scripts/**'
- '**.md'
- 'docs/*'

View file

@ -103,10 +103,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: 'install pmccabe'
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
@ -115,9 +111,25 @@ jobs:
sudo apt-get -o Dpkg::Use-Pty=0 install \
pmccabe
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: 'check scores'
run: ./scripts/top-complexity
xmllint:
name: 'xmllint'
runs-on: macos-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: 'check'
run: git grep -z -i -l -E '^<\?xml' | xargs -0 -r xmllint >/dev/null
miscchecks:
name: 'misc checks'
runs-on: ubuntu-latest
@ -162,6 +174,7 @@ jobs:
- name: 'yamlcheck'
run: .github/scripts/yamlcheck.sh
# we allow some extra in source code
- name: 'badwords'
run: grep -Ev '(\\bwill| url | dir )' .github/scripts/badwords.txt | .github/scripts/badwords.pl src lib include
run: |
# we allow some extra in source code
grep -Ev '(\\bwill| But: | So : )' .github/scripts/badwords.txt | .github/scripts/badwords.pl -a src lib include docs/examples

View file

@ -39,6 +39,7 @@ permissions: {}
jobs:
gha_python:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
name: 'GHA and Python'
runs-on: ubuntu-latest
permissions:
@ -58,6 +59,7 @@ jobs:
uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3
c:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
name: 'C'
runs-on: ${{ matrix.platform == 'Linux' && 'ubuntu-latest' || 'windows-2022' }}
permissions:

View file

@ -189,7 +189,7 @@ jobs:
if: ${{ steps.cache-openssl-http3-no-deprecated.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl
git clone --quiet --depth 1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl
cd openssl
./config --prefix="$PWD"/build --libdir=lib no-makedepend no-apps no-docs no-tests no-deprecated
make
@ -232,7 +232,7 @@ jobs:
if: ${{ steps.cache-gnutls.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "${GNUTLS_VERSION}" https://github.com/gnutls/gnutls.git
git clone --quiet --depth 1 -b "${GNUTLS_VERSION}" https://github.com/gnutls/gnutls
cd gnutls
# required: nettle-dev libp11-kit-dev libev-dev autopoint bison gperf gtk-doc-tools libtasn1-bin
./bootstrap
@ -247,7 +247,7 @@ jobs:
if: ${{ steps.cache-wolfssl.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "v${WOLFSSL_VERSION}-stable" https://github.com/wolfSSL/wolfssl.git
git clone --quiet --depth 1 -b "v${WOLFSSL_VERSION}-stable" https://github.com/wolfSSL/wolfssl
cd wolfssl
./autogen.sh
./configure --disable-dependency-tracking --enable-all --enable-quic \
@ -259,9 +259,9 @@ jobs:
if: ${{ steps.cache-nghttp3.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "v${NGHTTP3_VERSION}" https://github.com/ngtcp2/nghttp3
git clone --quiet --depth 1 -b "v${NGHTTP3_VERSION}" https://github.com/ngtcp2/nghttp3
cd nghttp3
git submodule update --init --depth=1
git submodule update --init --depth 1
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only
make
@ -272,7 +272,7 @@ jobs:
# building twice to get crypto libs for ossl, libressl and awslc installed
run: |
cd ~
git clone --quiet --depth=1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2
git clone --quiet --depth 1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2
cd ngtcp2
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build \
@ -290,7 +290,7 @@ jobs:
if: ${{ steps.cache-ngtcp2-boringssl.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 ngtcp2-boringssl
git clone --quiet --depth 1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 ngtcp2-boringssl
cd ngtcp2-boringssl
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build \
@ -303,9 +303,9 @@ jobs:
if: ${{ steps.cache-nghttp2.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "v${NGHTTP2_VERSION}" https://github.com/nghttp2/nghttp2
git clone --quiet --depth 1 -b "v${NGHTTP2_VERSION}" https://github.com/nghttp2/nghttp2
cd nghttp2
git submodule update --init --depth=1
git submodule update --init --depth 1
autoreconf -fi
# required (for nghttpx application): libc-ares-dev libev-dev zlib1g-dev
# optional (for nghttpx application): libbrotli-dev
@ -578,7 +578,7 @@ jobs:
if: ${{ matrix.build.name == 'quiche' && steps.cache-quiche.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "${QUICHE_VERSION}" --recursive https://github.com/cloudflare/quiche.git
git clone --quiet --depth 1 -b "${QUICHE_VERSION}" --recursive https://github.com/cloudflare/quiche
cd quiche
#### Work-around https://github.com/curl/curl/issues/7927 #######
#### See https://github.com/alexcrichton/cmake-rs/issues/131 ####

View file

@ -329,10 +329,10 @@ jobs:
install_steps: intel
configure: CC=icc --enable-debug --with-openssl
- name: 'Slackware openssl gssapi gcc'
# These are essentially the same flags used to build the curl Slackware package
- name: 'Slackware !ssl gssapi gcc'
# Flags used to build the curl Slackware package, except OpenSSL 1.1.0:
# https://ftpmirror.infania.net/slackware/slackware64-current/source/n/curl/curl.SlackBuild
configure: --enable-debug --with-openssl --with-libssh2 --with-gssapi --enable-ares --enable-static=no --without-ca-bundle --with-ca-path=/etc/ssl/certs
configure: --enable-debug --without-ssl --with-libssh2 --with-gssapi --enable-ares --enable-static=no --without-ca-bundle --with-ca-path=/etc/ssl/certs
# Docker Hub image that `container-job` executes in
container: 'andy5995/slackware-build-essential:15.0'
@ -439,6 +439,7 @@ jobs:
cmake --install .
- name: 'cache nghttp2 (filc)'
if: ${{ contains(matrix.build.install_steps, 'nghttp2-filc') }}
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
id: cache-nghttp2-filc
env:
@ -579,7 +580,7 @@ jobs:
- name: 'build openssl (thread sanitizer)'
if: ${{ contains(matrix.build.install_steps, 'openssl-tsan') && steps.cache-openssl-tsan.outputs.cache-hit != 'true' }}
run: |
git clone --quiet --depth=1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl
git clone --quiet --depth 1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl
cd openssl
CC=clang CFLAGS='-fsanitize=thread' LDFLAGS='-fsanitize=thread' ./config --prefix=/home/runner/openssl --libdir=lib no-makedepend no-apps no-docs no-tests
make

View file

@ -29,7 +29,7 @@ if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG))
# e.g. curl_easy_perform_ev() or curl_dbg_*(),
# so disable symbol hiding for debug builds and for memory tracking.
set(CURL_HIDDEN_SYMBOLS OFF)
elseif(DOS OR AMIGA OR MINGW32CE)
elseif(DOS OR AMIGA)
set(CURL_HIDDEN_SYMBOLS OFF)
endif()

View file

@ -232,20 +232,20 @@ if(PICKY_COMPILER)
-Wcast-function-type-strict # clang 16.0 appleclang 16.0
)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.0)
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.1)
list(APPEND _picky_enable
-Warray-compare # clang 20.0 gcc 12.0 appleclang ?
-Wc++-hidden-decl # clang 21.0 appleclang ?
-Wno-implicit-void-ptr-cast # clang 21.0 appleclang ?
-Wtentative-definition-compat # clang 21.0 appleclang ?
-Warray-compare # clang 20.1 gcc 12.0 appleclang ?
-Wc++-hidden-decl # clang 21.1 appleclang ?
-Wno-implicit-void-ptr-cast # clang 21.1 appleclang ?
-Wtentative-definition-compat # clang 21.1 appleclang ?
)
if(WIN32)
list(APPEND _picky_enable
-Wno-c++-keyword # clang 21.0 appleclang ? # `wchar_t` triggers it on Windows
-Wno-c++-keyword # clang 21.1 appleclang ? # `wchar_t` triggers it on Windows
)
else()
list(APPEND _picky_enable
-Wc++-keyword # clang 21.0 appleclang ?
-Wc++-keyword # clang 21.1 appleclang ?
)
endif()
endif()

View file

@ -53,11 +53,7 @@ else()
if(MSVC)
set(HAVE_UNISTD_H 0)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
if(MSVC_VERSION GREATER_EQUAL 1600)
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
else()
set(HAVE_STDINT_H 0) # detected by CMake internally in check_type_size()
endif()
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
if(MSVC_VERSION GREATER_EQUAL 1800)
set(HAVE_STDBOOL_H 1)
else()
@ -193,7 +189,7 @@ if(MINGW OR MSVC)
curl_prefill_type_size("CURL_OFF_T" 8)
curl_prefill_type_size("CURL_SOCKET_T" ${CMAKE_SIZEOF_VOID_P})
curl_prefill_type_size("SIZE_T" ${CMAKE_SIZEOF_VOID_P})
# TIME_T: 8 for _WIN64 or UCRT or MSVC and not Windows CE, 4 otherwise
# TIME_T: 8 for _WIN64 or UCRT or MSVC, 4 otherwise
# Also 4 for non-UCRT 32-bit when _USE_32BIT_TIME_T is set.
# mingw-w64 sets _USE_32BIT_TIME_T unless __MINGW_USE_VC2005_COMPAT is explicit defined.
if(MSVC)
@ -206,25 +202,3 @@ if(MINGW OR MSVC)
curl_prefill_type_size("OFF_T" 8) # mingw-w64 v3+
endif()
endif()
# Windows CE exceptions
if(WINCE)
set(HAVE_FREEADDRINFO 0)
set(HAVE_GETADDRINFO 0)
set(HAVE_LOCALE_H 0)
set(HAVE_SETLOCALE 0)
set(HAVE_SETMODE 0)
set(HAVE_SIGNAL 0)
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 0)
curl_prefill_type_size("CURL_SOCKET_T" 4)
curl_prefill_type_size("TIME_T" 4)
curl_prefill_type_size("SIZE_T" 4)
if(MINGW32CE)
set(HAVE_STRTOK_R 0)
set(HAVE__SETMODE 0)
set(HAVE_FILE_OFFSET_BITS 0)
curl_prefill_type_size("SSIZE_T" 4)
curl_prefill_type_size("OFF_T" 4)
endif()
endif()

View file

@ -21,7 +21,6 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# by Tetetest and Sukender (Benoit Neil)
cmake_minimum_required(VERSION 3.7...3.16 FATAL_ERROR)
message(STATUS "Using CMake version ${CMAKE_VERSION}")
@ -71,37 +70,6 @@ if(WINDOWS_STORE AND MINGW) # mingw UWP build
# CMake (as of v3.31.2) gets confused and applies the MSVC rc.exe command-line
# template to windres. Reset it to the windres template via 'Modules/Platform/Windows-windres.cmake':
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <DEFINES> <INCLUDES> <FLAGS> <SOURCE> <OBJECT>")
elseif(WIN32 AND WINCE AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # mingw32ce build
if(NOT MINGW32CE_LIBRARY_DIR)
message(FATAL_ERROR "Set MINGW32CE_LIBRARY_DIR variable to the mingw32ce platform library directory.")
endif()
set(MINGW 1)
set(MINGW32CE 1)
# Build implib with libcurl DLL. Copied from CMake's 'Modules/Platform/Windows-GNU.cmake'.
set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS>")
string(APPEND CMAKE_C_CREATE_SHARED_LIBRARY " <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB>")
string(APPEND CMAKE_C_CREATE_SHARED_LIBRARY " ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
# Build resources. Copied from CMake's 'Modules/Platform/Windows-windres.cmake'.
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <DEFINES> <INCLUDES> <FLAGS> <SOURCE> <OBJECT>")
enable_language(RC)
# To compile long long integer literals
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-std=gnu99")
string(APPEND CMAKE_REQUIRED_FLAGS " -std=gnu99")
set(CMAKE_C_COMPILE_OPTIONS_PIC "") # CMake sets it to '-fPIC', confusing the toolchain and breaking builds. Zap it.
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
set(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
set(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a" ".lib")
elseif(DOS AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # DJGPP
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
@ -130,9 +98,6 @@ endif()
if(WIN32)
string(APPEND _target_flags " WIN32")
endif()
if(WINCE)
string(APPEND _target_flags " WINCE")
endif()
if(WINDOWS_STORE)
string(APPEND _target_flags " UWP")
endif()
@ -213,12 +178,12 @@ option(CURL_DISABLE_INSTALL "Disable installation targets" OFF)
if(WIN32)
option(ENABLE_UNICODE "Use the Unicode version of the Windows API functions" OFF)
if(WINDOWS_STORE OR WINCE)
if(WINDOWS_STORE)
set(ENABLE_UNICODE ON)
endif()
if(ENABLE_UNICODE)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "UNICODE" "_UNICODE")
if(MINGW AND NOT MINGW32CE)
if(MINGW)
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-municode")
endif()
endif()
@ -538,7 +503,7 @@ if(HTTP_ONLY)
set(CURL_DISABLE_TFTP ON)
endif()
if(WINDOWS_STORE OR WINCE)
if(WINDOWS_STORE)
set(CURL_DISABLE_TELNET ON) # telnet code needs fixing to compile for UWP.
endif()
@ -624,21 +589,7 @@ if(ENABLE_THREADED_RESOLVER)
endif()
# Check for all needed libraries
if(WIN32)
if(WINCE)
set(_win32_winsock "ws2")
else()
set(_win32_winsock "ws2_32")
endif()
set(_win32_crypt32 "crypt32")
set(_win32_secur32 "secur32")
if(MINGW32CE) # FIXME upstream: must specify the full path to avoid CMake converting "ws2" to "ws2.lib"
set(_win32_winsock "${MINGW32CE_LIBRARY_DIR}/lib${_win32_winsock}.a")
set(_win32_crypt32 "${MINGW32CE_LIBRARY_DIR}/lib${_win32_crypt32}.a")
set(_win32_secur32 "${MINGW32CE_LIBRARY_DIR}/lib${_win32_secur32}.a")
endif()
elseif(DOS)
if(DOS)
if(WATT_ROOT)
set(USE_WATT32 ON)
# FIXME upstream: must specify the full path to avoid CMake converting "watt" to "watt.lib"
@ -659,7 +610,7 @@ elseif(AMIGA)
set(CURL_USE_OPENSSL ON)
set(CURL_CA_FALLBACK ON CACHE BOOL "")
endif()
elseif(NOT APPLE)
elseif(NOT WIN32 AND NOT APPLE)
check_library_exists("socket" "connect" "" HAVE_LIBSOCKET)
if(HAVE_LIBSOCKET)
set(CURL_NETWORK_AND_TIME_LIBS "socket" ${CURL_NETWORK_AND_TIME_LIBS})
@ -694,7 +645,7 @@ if(ENABLE_IPV6)
endif()
endif()
endif()
if(ENABLE_IPV6 AND NOT WINCE)
if(ENABLE_IPV6)
set(USE_IPV6 ON)
endif()
@ -1035,7 +986,7 @@ macro(curl_openssl_check_exists)
if(HAVE_LIBZ)
list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB)
endif()
if(WIN32 AND NOT WINCE)
if(WIN32)
list(APPEND CMAKE_REQUIRED_LIBRARIES "bcrypt") # for OpenSSL/LibreSSL
endif()
endif()
@ -1049,7 +1000,7 @@ macro(curl_openssl_check_exists)
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DHAVE_UINTPTR_T") # to pull in stdint.h (as of wolfSSL v5.5.4)
endif()
if(WIN32)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${_win32_winsock}" "${_win32_crypt32}") # for OpenSSL/wolfSSL
list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32" "crypt32") # for OpenSSL/wolfSSL
endif()
if(${ARGC} EQUAL 2)
check_function_exists(${ARGN})
@ -1262,7 +1213,7 @@ if(NOT CURL_DISABLE_SRP AND (HAVE_GNUTLS_SRP OR HAVE_OPENSSL_SRP))
endif()
if(NOT CURL_DISABLE_LDAP)
if(WIN32 AND NOT WINDOWS_STORE AND NOT WINCE)
if(WIN32 AND NOT WINDOWS_STORE)
option(USE_WIN32_LDAP "Use Windows LDAP implementation" ON)
if(USE_WIN32_LDAP)
list(APPEND CURL_LIBS "wldap32")
@ -1501,7 +1452,7 @@ if(USE_LIBRTMP)
endif()
option(ENABLE_UNIX_SOCKETS "Enable Unix domain sockets support" ON)
if(ENABLE_UNIX_SOCKETS AND NOT WINCE)
if(ENABLE_UNIX_SOCKETS)
if(WIN32 OR DOS)
set(USE_UNIX_SOCKETS 1)
else()
@ -1618,7 +1569,7 @@ if(WIN32)
list(APPEND CURL_INCLUDES "winsock2.h")
list(APPEND CURL_INCLUDES "ws2tcpip.h")
if(HAVE_WIN32_WINNT AND HAVE_WIN32_WINNT LESS 0x0501 AND NOT WINCE)
if(HAVE_WIN32_WINNT AND HAVE_WIN32_WINNT LESS 0x0501)
# Windows XP is required for freeaddrinfo, getaddrinfo
message(FATAL_ERROR "Building for Windows XP or newer is required.")
endif()
@ -1626,7 +1577,7 @@ if(WIN32)
# Pre-fill detection results based on target OS version
if(_CURL_PREFILL)
if(NOT HAVE_WIN32_WINNT OR HAVE_WIN32_WINNT LESS 0x0600 OR # older than Windows Vista
WINCE OR WINDOWS_STORE)
WINDOWS_STORE)
set(HAVE_IF_NAMETOINDEX 0)
unset(HAVE_IF_NAMETOINDEX CACHE)
elseif(MSVC OR MINGW)
@ -1734,8 +1685,8 @@ endif()
# Apply to all feature checks
if(WIN32)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${_win32_winsock}")
if(NOT WINCE AND NOT WINDOWS_STORE)
list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32")
if(NOT WINDOWS_STORE)
list(APPEND CMAKE_REQUIRED_LIBRARIES "iphlpapi")
endif()
elseif(HAVE_LIBSOCKET)
@ -1789,9 +1740,9 @@ check_function_exists("eventfd" HAVE_EVENTFD)
check_symbol_exists("ftruncate" "unistd.h" HAVE_FTRUNCATE)
check_symbol_exists("getpeername" "${CURL_INCLUDES}" HAVE_GETPEERNAME) # winsock2.h unistd.h proto/bsdsocket.h
check_symbol_exists("getsockname" "${CURL_INCLUDES}" HAVE_GETSOCKNAME) # winsock2.h unistd.h proto/bsdsocket.h
check_function_exists("getrlimit" HAVE_GETRLIMIT)
check_function_exists("setlocale" HAVE_SETLOCALE)
check_function_exists("setrlimit" HAVE_SETRLIMIT)
check_function_exists("getrlimit" HAVE_GETRLIMIT)
check_function_exists("setlocale" HAVE_SETLOCALE)
check_function_exists("setrlimit" HAVE_SETRLIMIT)
if(WIN32)
# include wincrypt.h as a workaround for mingw-w64 __MINGW64_VERSION_MAJOR <= 5 header bug */
@ -1800,16 +1751,14 @@ else()
check_function_exists("if_nametoindex" HAVE_IF_NAMETOINDEX) # net/if.h
check_function_exists("realpath" HAVE_REALPATH)
check_function_exists("sched_yield" HAVE_SCHED_YIELD)
check_symbol_exists("strcasecmp" "string.h" HAVE_STRCASECMP)
check_symbol_exists("stricmp" "string.h" HAVE_STRICMP)
check_symbol_exists("strcmpi" "string.h" HAVE_STRCMPI)
check_symbol_exists("strcasecmp" "string.h" HAVE_STRCASECMP)
check_symbol_exists("stricmp" "string.h" HAVE_STRICMP)
check_symbol_exists("strcmpi" "string.h" HAVE_STRCMPI)
endif()
if(NOT MINGW32CE) # Avoid false detections
check_function_exists("setmode" HAVE_SETMODE)
if(WIN32 OR CYGWIN)
check_function_exists("_setmode" HAVE__SETMODE)
endif()
check_function_exists("setmode" HAVE_SETMODE)
if(WIN32 OR CYGWIN)
check_function_exists("_setmode" HAVE__SETMODE)
endif()
if(AMIGA)
@ -1971,17 +1920,13 @@ include(CMake/OtherTests.cmake)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "HAVE_CONFIG_H")
if(WIN32)
list(APPEND CURL_NETWORK_AND_TIME_LIBS "${_win32_winsock}")
if(NOT WINCE AND NOT WINDOWS_STORE)
list(APPEND CURL_NETWORK_AND_TIME_LIBS "ws2_32")
if(NOT WINDOWS_STORE)
list(APPEND CURL_NETWORK_AND_TIME_LIBS "iphlpapi")
endif()
if(NOT WINCE)
list(APPEND CURL_LIBS "bcrypt")
endif()
list(APPEND CURL_LIBS "bcrypt")
if(NOT WINCE)
set(USE_WIN32_LARGE_FILES ON)
endif()
set(USE_WIN32_LARGE_FILES ON)
# We use crypto functions that are not available for UWP apps
if(NOT WINDOWS_STORE)
@ -1990,13 +1935,10 @@ if(WIN32)
# Link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL
if(USE_WIN32_CRYPTO OR USE_SCHANNEL)
if(NOT WINCE)
list(APPEND CURL_LIBS "advapi32")
endif()
list(APPEND CURL_LIBS "${_win32_crypt32}")
list(APPEND CURL_LIBS "advapi32" "crypt32")
endif()
if(USE_WINDOWS_SSPI)
list(APPEND CURL_LIBS "${_win32_secur32}")
list(APPEND CURL_LIBS "secur32")
endif()
endif()
@ -2209,8 +2151,7 @@ message(STATUS "Features: ${SUPPORT_FEATURES}")
# Clear list and collect SSL backends
set(_items "")
curl_add_if("Schannel" _ssl_enabled AND USE_SCHANNEL)
curl_add_if("${_openssl}" _ssl_enabled AND USE_OPENSSL AND OPENSSL_VERSION VERSION_LESS 3.0.0)
curl_add_if("${_openssl} v3+" _ssl_enabled AND USE_OPENSSL AND OPENSSL_VERSION VERSION_GREATER_EQUAL 3.0.0)
curl_add_if("${_openssl}" _ssl_enabled AND USE_OPENSSL)
curl_add_if("mbedTLS" _ssl_enabled AND USE_MBEDTLS)
curl_add_if("wolfSSL" _ssl_enabled AND USE_WOLFSSL)
curl_add_if("GnuTLS" _ssl_enabled AND USE_GNUTLS)

View file

@ -4,10 +4,13 @@ curl and libcurl 8.18.0
Command line options: 273
curl_easy_setopt() options: 308
Public functions in libcurl: 100
Contributors: 3537
Contributors: 3541
This release includes the following changes:
o build: drop support for VS2008 (Windows) [62]
o build: drop Windows CE / CeGCC support [69]
o openssl: bump minimum OpenSSL version to 3.0.0 [60]
This release includes the following bugfixes:
@ -16,12 +19,19 @@ This release includes the following bugfixes:
o autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr) [70]
o ccsidcurl: make curl_mime_data_ccsid() use the converted size [74]
o cf-https-connect: allocate ctx at first in cf_hc_create() [79]
o cf-socket: trace ignored errors [97]
o checksrc.pl: detect assign followed by more than one space [26]
o cmake: adjust defaults for target platforms not supporting shared libs [35]
o cmake: disable `CURL_CA_PATH` auto-detection if `USE_APPLE_SECTRUST=ON` [16]
o code: minor indent fixes before closing braces [107]
o config2setopts: bail out if curl_url_get() returns OOM [102]
o config2setopts: exit if curl_url_set() fails on OOM [105]
o conncache: silence `-Wnull-dereference` on gcc 14 RISC-V 64 [17]
o connect: reshuffle Curl_timeleft_ms to avoid 'redundant condition' [100]
o cookie: propagate errors better, cleanup the internal API [118]
o cshutdn: acknowledge FD_SETSIZE for shutdown descriptors [25]
o curl: fix progress meter in parallel mode [15]
o curl_setup.h: drop stray `#undef stat` (Windows) [103]
o CURLINFO: remove 'get' and 'get the' from each short desc [50]
o CURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer" [48]
o CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text [49]
@ -31,8 +41,10 @@ This release includes the following bugfixes:
o docs: fix checksrc `EQUALSPACE` warnings [21]
o docs: mention umask need when curl creates files [56]
o examples/crawler: fix variable [92]
o examples/multithread: fix race condition [101]
o ftp: refactor a piece of code by merging the repeated part [40]
o ftp: remove #ifdef for define that is always defined [76]
o getinfo: improve perf in debug mode [99]
o gnutls: report accurate error when TLS-SRP is not built-in [18]
o gtls: add return checks and optimize the code [2]
o gtls: skip session resumption when verifystatus is set
@ -41,12 +53,16 @@ This release includes the following bugfixes:
o INSTALL-CMAKE.md: document static option defaults more [37]
o krb5_sspi: unify a part of error handling [80]
o lib: cleanup for some typos about spaces and code style [3]
o lib: eliminate size_t casts [112]
o lib: fix gssapi.h include on IBMi [55]
o lib: refactor the type of funcs which have useless return and checks [1]
o libtests: replace `atoi()` with `curlx_str_number()` [120]
o libssh2: cleanup ssh_force_knownhost_key_type [64]
o libssh2: replace atoi() in ssh_force_knownhost_key_type [63]
o limit-rate: add example using --limit-rate and --max-time together [89]
o m4/sectrust: fix test(1) operator [4]
o mbedtls: fix potential use of uninitialized `nread` [8]
o mk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option [73]
o mk-ca-bundle.pl: use `open()` with argument list to replace backticks [71]
o mqtt: reject overly big messages [39]
o noproxy: replace atoi with curlx_str_number [67]
@ -59,8 +75,12 @@ This release includes the following bugfixes:
o pytest: skip H2 tests if feature missing from curl [46]
o rtmp: fix double-free on URL parse errors [27]
o rtmp: precaution for a potential integer truncation [54]
o runtests: detect bad libssh differently for test 1459 [11]
o runtests: drop Python 2 support remains [45]
o rustls: fix a potential memory issue [81]
o rustls: minor adjustment of sizeof() [38]
o schannel: fix memory leak of cert_store_path on four error paths [23]
o schannel: replace atoi() with curlx_str_number() [119]
o scripts: fix shellcheck SC2046 warnings [90]
o scripts: use end-of-options marker in `find -exec` commands [87]
o setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL [30]
@ -68,25 +88,32 @@ This release includes the following bugfixes:
o sftp: fix range downloads in both SSH backends [82]
o socks_sspi: use free() not FreeContextBuffer() [93]
o telnet: replace atoi for BINARY handling with curlx_str_number [66]
o test07_22: fix flakiness [95]
o test2045: replace HTML multi-line comment markup with `#` comments [36]
o test363: delete stray character (typo) from a section tag [52]
o tests/data: replace hard-coded test numbers with `%TESTNUMBER` [33]
o tests/data: support using native newlines on disk, drop `.gitattributes` [91]
o tests/server: do not fall back to original data file in `test2fopen()` [32]
o tests/server: replace `atoi()` and `atol()` with `curlx_str_number()` [110]
o tftp: release filename if conn_get_remote_addr fails [42]
o tool: consider (some) curl_easy_setopt errors fatal [7]
o tool_help: add checks to avoid unsigned wrap around [14]
o tool_ipfs: check return codes better [20]
o tool_operate: exit on curl_share_setopt errors [108]
o tool_operate: remove redundant condition [19]
o tool_operate: use curlx_str_number instead of atoi [68]
o tool_paramhlp: refuse --proto remove all protocols [10]
o urlapi: fix mem-leaks in curl_url_get error paths [22]
o verify-release: update to avoid shellcheck warning SC2034 [88]
o vquic-tls/gnutls: call Curl_gtls_verifyserver unconditionally [96]
o vtls: fix CURLOPT_CAPATH use [51]
o vtls: handle possible malicious certs_num from peer [53]
o vtls: pinned key check [98]
o wcurl: import v2025.11.09 [29]
o wolfSSL: able to differentiate between IP and DNS in alt names [13]
o wolfssl: avoid NULL dereference in OOM situation [77]
o wolfssl: fix a potential memory leak of session [6]
o wolfssl: simplify wssl_send_earlydata [111]
This release includes the following known bugs:
@ -98,24 +125,22 @@ For all changes ever done in curl:
Planned upcoming removals include:
o Builds using VS2008
o OpenSSL 1.x support
o OpenSSL-QUIC
o Support for c-ares versions before 1.16.0
o Support for Windows XP/2003
o Windows CE support
See https://curl.se/dev/deprecate.html
This release would not have looked like this without help, code, reports and
advice from friends like these:
Andrew Kirillov, Brad King, Dan Fandrich, Daniel Stenberg,
Fd929c2CE5fA on github, Gisle Vanem, Jiyong Yang, Juliusz Sosinowicz,
Leonardo Taccari, Patrick Monnerat, Ray Satiro, renovate[bot],
Aleksandr Sergeev, Andrew Kirillov, Brad King, Dan Fandrich, Daniel McCarney,
Daniel Stenberg, Fd929c2CE5fA on github, Gisle Vanem, Jiyong Yang,
Juliusz Sosinowicz, Leonardo Taccari, nait-furry, Nick Korepanov,
Patrick Monnerat, pelioro on hackerone, Ray Satiro, renovate[bot],
Samuel Henrique, Stanislav Fort, Stefan Eissing, Thomas Klausner,
Viktor Szakats, Xiaoke Wang
(18 contributors)
(23 contributors)
References to bug reports and discussions on issues:
@ -124,10 +149,12 @@ References to bug reports and discussions on issues:
[3] = https://curl.se/bug/?i=19370
[4] = https://curl.se/bug/?i=19371
[5] = https://curl.se/bug/?i=19394
[6] = https://curl.se/bug/?i=19555
[7] = https://curl.se/bug/?i=19385
[8] = https://curl.se/bug/?i=19393
[9] = https://curl.se/bug/?i=19389
[10] = https://curl.se/bug/?i=19388
[11] = https://curl.se/bug/?i=19557
[12] = https://curl.se/bug/?i=19426
[13] = https://curl.se/bug/?i=19364
[14] = https://curl.se/bug/?i=19377
@ -152,11 +179,13 @@ References to bug reports and discussions on issues:
[35] = https://curl.se/bug/?i=19420
[36] = https://curl.se/bug/?i=19498
[37] = https://curl.se/bug/?i=19419
[38] = https://hackerone.com/reports/3427460
[39] = https://curl.se/bug/?i=19415
[40] = https://curl.se/bug/?i=19411
[41] = https://curl.se/bug/?i=19410
[42] = https://curl.se/bug/?i=19409
[43] = https://curl.se/bug/?i=19405
[45] = https://curl.se/bug/?i=19544
[46] = https://curl.se/bug/?i=19412
[47] = https://curl.se/bug/?i=19402
[48] = https://curl.se/bug/?i=19403
@ -168,15 +197,19 @@ References to bug reports and discussions on issues:
[54] = https://curl.se/bug/?i=19399
[55] = https://curl.se/bug/?i=19336
[56] = https://curl.se/bug/?i=19396
[60] = https://curl.se/bug/?i=18330
[61] = https://curl.se/bug/?i=19484
[62] = https://curl.se/bug/?i=17931
[63] = https://curl.se/bug/?i=19479
[64] = https://curl.se/bug/?i=19479
[65] = https://curl.se/bug/?i=19478
[66] = https://curl.se/bug/?i=19477
[67] = https://curl.se/bug/?i=19475
[68] = https://curl.se/bug/?i=19480
[69] = https://curl.se/bug/?i=17927
[70] = https://curl.se/bug/?i=19464
[71] = https://curl.se/bug/?i=19461
[73] = https://curl.se/bug/?i=19359
[74] = https://curl.se/bug/?i=19465
[76] = https://curl.se/bug/?i=19463
[77] = https://curl.se/bug/?i=19459
@ -188,8 +221,27 @@ References to bug reports and discussions on issues:
[86] = https://curl.se/bug/?i=19451
[87] = https://curl.se/bug/?i=19450
[88] = https://curl.se/bug/?i=19449
[89] = https://curl.se/bug/?i=19473
[90] = https://curl.se/bug/?i=19432
[91] = https://curl.se/bug/?i=19398
[92] = https://curl.se/bug/?i=19446
[93] = https://curl.se/bug/?i=19445
[94] = https://curl.se/bug/?i=19444
[95] = https://curl.se/bug/?i=19530
[96] = https://curl.se/bug/?i=19531
[97] = https://curl.se/bug/?i=19520
[98] = https://curl.se/bug/?i=19529
[99] = https://curl.se/bug/?i=19525
[100] = https://curl.se/bug/?i=19523
[101] = https://curl.se/bug/?i=19524
[102] = https://curl.se/bug/?i=19518
[103] = https://curl.se/bug/?i=19519
[105] = https://curl.se/bug/?i=19517
[107] = https://curl.se/bug/?i=19512
[108] = https://curl.se/bug/?i=19513
[110] = https://curl.se/bug/?i=19510
[111] = https://curl.se/bug/?i=19509
[112] = https://curl.se/bug/?i=19495
[118] = https://curl.se/bug/?i=19493
[119] = https://curl.se/bug/?i=19483
[120] = https://curl.se/bug/?i=19506

View file

@ -1315,13 +1315,8 @@ AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
if test "$curl_cv_native_windows" = 'yes'; then
AC_MSG_CHECKING([whether build target supports Win32 large files])
if test "$curl_cv_wince" = 'yes'; then
dnl Windows CE does not support large files
curl_win32_has_largefile='no'
else
dnl All mingw-w64 versions support large files
curl_win32_has_largefile='yes'
fi
dnl All mingw-w64 versions support large files
curl_win32_has_largefile='yes'
case "$curl_win32_has_largefile" in
yes)
if test x"$enable_largefile" = 'xno'; then
@ -1478,9 +1473,6 @@ AC_DEFUN([CURL_PREPARE_BUILDINFO], [
if test "$curl_cv_native_windows" = 'yes'; then
curl_pflags="${curl_pflags} WIN32"
fi
if test "$curl_cv_wince" = 'yes'; then
curl_pflags="${curl_pflags} WINCE"
fi
if test "$curl_cv_winuwp" = 'yes'; then
curl_pflags="${curl_pflags} UWP"
fi

View file

@ -35,12 +35,11 @@ esac
if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2022' ]; then
openssl_root_win="C:/OpenSSL-v35${openssl_suffix}"
openssl_root="$(cygpath "${openssl_root_win}")"
elif [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2019' ]; then
openssl_root_win="C:/OpenSSL-v30${openssl_suffix}"
else
openssl_root_win="C:/OpenSSL-v111${openssl_suffix}"
openssl_root="$(cygpath "${openssl_root_win}")"
fi
openssl_root="$(cygpath "${openssl_root_win}")"
if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
# Set env CHKPREFILL to the value '_chkprefill' to compare feature detection
@ -76,7 +75,7 @@ if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
-DCURL_USE_OPENSSL="${OPENSSL}" \
-DCURL_USE_LIBPSL=OFF \
${options} \
|| { cat ${root}/_bld/CMakeFiles/CMake* 2>/dev/null; false; }
|| { cat "${root}"/_bld/CMakeFiles/CMake* 2>/dev/null; false; }
[ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2013' ] && cd ..
done
if [ -d _bld_chkprefill ] && ! diff -u _bld/lib/curl_config.h _bld_chkprefill/lib/curl_config.h; then
@ -93,9 +92,11 @@ elif [ "${BUILD_SYSTEM}" = 'VisualStudioSolution' ]; then
(
cd projects
./generate.bat "${VC_VERSION}"
msbuild.exe -maxcpucount "-property:Configuration=${PRJ_CFG}" "Windows/${VC_VERSION}/curl-all.sln"
msbuild.exe -maxcpucount "-property:Configuration=${PRJ_CFG}" "-property:Platform=${PLAT}" "Windows/${VC_VERSION}/curl-all.sln"
)
curl="build/Win32/${VC_VERSION}/${PRJ_CFG}/curld.exe"
[ "${PLAT}" = 'x64' ] && platdir='Win64' || platdir='Win32'
[[ "${PRJ_CFG}" = *'Debug'* ]] && binsuffix='d' || binsuffix=''
curl="build/${platdir}/${VC_VERSION}/${PRJ_CFG}/curl${binsuffix}.exe"
fi
find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -exec file -- '{}' \;

View file

@ -70,35 +70,34 @@ environment:
SCHANNEL: 'ON'
SHARED: 'ON'
EXAMPLES: 'ON'
- job_name: 'CM VS2012, Release, x86, OpenSSL 1.1.1 + Schannel, Shared, Build-tests'
- job_name: 'CM VS2012, Release, x86, Schannel, Shared, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
PRJ_GEN: 'Visual Studio 11 2012'
TARGET: '-A Win32'
PRJ_CFG: Release
OPENSSL: 'ON'
SCHANNEL: 'ON'
SHARED: 'ON'
- job_name: 'CM VS2013, Debug, x64, OpenSSL 1.1.1, Shared, Build-only'
- job_name: 'CM VS2013, Debug, x64, Schannel, Shared, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
PRJ_GEN: 'Visual Studio 12 2013'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
SCHANNEL: 'ON'
SHARED: 'ON'
TFLAGS: 'skipall'
- job_name: 'CM VS2015, Debug, x64, OpenSSL 1.1.1, Static, Build-only'
- job_name: 'CM VS2015, Debug, x64, Schannel, Static, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
PRJ_GEN: 'Visual Studio 14 2015'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
SCHANNEL: 'ON'
TFLAGS: 'skipall'
- job_name: 'CM VS2017, Debug, x64, OpenSSL 1.1.1, Shared, Build-only'
- job_name: 'CM VS2017, Debug, x64, Schannel, Shared, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
PRJ_GEN: 'Visual Studio 15 2017'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
SCHANNEL: 'ON'
SHARED: 'ON'
TFLAGS: 'skipall'
- job_name: 'CM VS2019, Debug, x64, OpenSSL 3.0 + Schannel, Shared, Build-tests'
@ -149,10 +148,17 @@ environment:
# generated VisualStudioSolution-based builds
- job_name: 'VisualStudioSolution VS2013, Debug, x86, Schannel, Build-only'
- job_name: 'VisualStudioSolution VS2010, Release, x86, Schannel, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013'
BUILD_SYSTEM: VisualStudioSolution
PRJ_CFG: 'DLL Release - DLL Windows SSPI - DLL WinIDN'
PLAT: 'Win32'
VC_VERSION: VC10
- job_name: 'VisualStudioSolution VS2013, Debug, x64, Schannel, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: VisualStudioSolution
PRJ_CFG: 'DLL Debug - DLL Windows SSPI - DLL WinIDN'
PLAT: 'x64'
VC_VERSION: VC12
install:

View file

@ -529,12 +529,8 @@ dnl for --enable-code-coverage
CURL_COVERAGE
CURL_CHECK_NATIVE_WINDOWS
curl_cv_wince='no'
curl_cv_winuwp='no'
if test "$curl_cv_native_windows" = "yes"; then
case $host_os in
mingw32ce*) curl_cv_wince='yes';;
esac
case "$CPPFLAGS" in
*-DWINSTORECOMPAT*) curl_cv_winuwp='yes';;
esac
@ -896,7 +892,7 @@ AS_HELP_STRING([--disable-telnet],[Disable TELNET support]),
AC_MSG_RESULT(yes)
)
if test "$curl_cv_winuwp" = 'yes' -o "$curl_cv_wince" = 'yes'; then
if test "$curl_cv_winuwp" = 'yes'; then
AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
CURL_DISABLE_TELNET=1
fi
@ -1177,37 +1173,6 @@ if test "$HAVE_GETHOSTBYNAME" != "1"; then
])
fi
if test "$HAVE_GETHOSTBYNAME" != "1"; then
if test "$curl_cv_wince" = 'yes'; then
dnl This is for Windows CE systems
winsock_LIB="-lws2"
if test ! -z "$winsock_LIB"; then
my_ac_save_LIBS=$LIBS
LIBS="$winsock_LIB $LIBS"
AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
#endif
]],[[
gethostbyname("localhost");
]])
],[
AC_MSG_RESULT([yes])
HAVE_GETHOSTBYNAME="1"
],[
AC_MSG_RESULT([no])
winsock_LIB=""
LIBS=$my_ac_save_LIBS
])
fi
fi
fi
# In UWP mode gethostbyname gets detected via the core libs, but some
# code (in6addr_any) still need ws2_32, so let us detect and add it.
if test "$HAVE_GETHOSTBYNAME" != "1" -o "$curl_cv_winuwp" = "yes"; then
@ -1693,10 +1658,6 @@ AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
)
)
if test "$curl_cv_wince" = 'yes'; then
ipv6=no
fi
if test "$ipv6" = yes; then
curl_ipv6_msg="enabled"
AC_DEFINE(USE_IPV6, 1, [Define if you want to enable IPv6 support])
@ -1998,14 +1959,11 @@ CURL_WITH_APPLE_SECTRUST
dnl link required libraries for USE_WIN32_CRYPTO or SCHANNEL_ENABLED
if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$SCHANNEL_ENABLED" = "x1"; then
LIBS="-lcrypt32 $LIBS"
if test "$curl_cv_wince" = 'no'; then
LIBS="-ladvapi32 $LIBS"
fi
LIBS="-ladvapi32 -lcrypt32 $LIBS"
fi
dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer)
if test "x$curl_cv_native_windows" = "xyes" -a "$curl_cv_wince" = 'no'; then
if test "x$curl_cv_native_windows" = "xyes"; then
LIBS="-lbcrypt $LIBS"
fi
@ -2750,11 +2708,7 @@ dnl ----------------------------
dnl check Windows Unicode option
dnl ----------------------------
if test "$curl_cv_wince" = 'yes'; then
want_winuni="yes"
else
want_winuni="no"
fi
want_winuni="no"
if test "$curl_cv_native_windows" = "yes"; then
if test "$curl_cv_winuwp" = 'yes'; then
want_winuni="yes"
@ -4266,11 +4220,9 @@ else
CURL_CHECK_FUNC_STRICMP
fi
if test "$curl_cv_wince" = 'no'; then
AC_CHECK_FUNCS([setmode])
if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then
AC_CHECK_FUNCS([_setmode])
fi
AC_CHECK_FUNCS([setmode])
if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then
AC_CHECK_FUNCS([_setmode])
fi
if test -z "$ssl_backends"; then
@ -4639,7 +4591,7 @@ AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
want_unix_sockets=auto
]
)
if test "x$want_unix_sockets" != "xno" -a "$curl_cv_wince" = 'no'; then
if test "x$want_unix_sockets" != "xno"; then
if test "x$curl_cv_native_windows" = "xyes"; then
USE_UNIX_SOCKETS=1
AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])

View file

@ -61,7 +61,7 @@ Go: [go-curl](https://github.com/andelf/go-curl) by ShuYu Wang
[Haskell](https://hackage.haskell.org/package/curl) Written by Galois, Inc
[Hollywood](https://web.archive.org/web/20250116185836/https://www.hollywood-mal.com/download.html) hURL by Andreas Falkenhahn
[Hollywood](https://web.archive.org/web/20250116185836/www.hollywood-mal.com/download.html) hURL by Andreas Falkenhahn
[Java](https://github.com/covers1624/curl4j)

View file

@ -12,24 +12,6 @@ email the
as soon as possible and explain to us why this is a problem for you and
how your use case cannot be satisfied properly using a workaround.
## Windows CE
Windows CE "mainstream support" ended on October 9, 2018, and "Extended
Support" ended on October 10, 2023.
curl drops all support in November 2025.
## VS2008
curl drops support for getting built with Microsoft Visual Studio 2008 in
November 2025.
The only reason we kept support for this version is for Windows CE - and we
intend to remove support for that Operating System in this time frame as well.
Bumping the minimum to VS2010. VS2008 is a pain to support.
Previous discussion and details: https://github.com/curl/curl/discussions/15972
## Windows XP
In January 2026, curl drops support for Windows XP and Server 2003. Their
@ -41,20 +23,6 @@ Making the new minimum target Windows version Vista / Server 2008.
In March 2026, we drop support for all c-ares versions before 1.16.0.
## OpenSSL 1.0.2
OpenSSL and others only ship fixes for this version to paying customers,
meaning users of the free version risk being vulnerable.
We remove support for this OpenSSL version from curl in December 2025.
## OpenSSL 1.1.1
OpenSSL and others only ship fixes to paying customers, meaning users of the
free version risk being vulnerable.
We remove support for this OpenSSL version from curl in December 2025.
## OpenSSL-QUIC
OpenSSL-QUIC is what we call the curl QUIC backend that uses the OpenSSL QUIC
@ -70,6 +38,18 @@ stack.
We remove the OpenSSL-QUIC backend in March 2026.
## RTMP
RTMP in curl is powered by the 3rd party library librtmp.
- RTMP is barely used by curl users (2.2% in the 2025 survey)
- librtmp has no test cases, makes no proper releases and has not had a single
commit within the last year
- librtmp parses the URL itself and requires non-compliant URLs for this
- we have no RTMP tests
Support for RTMP in libcurl gets removed in April 2026.
## Past removals
- axTLS (removed in 7.63.0)
@ -88,3 +68,6 @@ We remove the OpenSSL-QUIC backend in March 2026.
- BearSSL (removed in 8.15.0)
- msh3 (removed in 8.16.0)
- winbuild build system (removed in 8.17.0)
- Windows CE (removed in 8.18.0)
- Support for Visual Studio 2008 (removed in 8.18.0)
- OpenSSL 1.1.1 and older (removed in 8.18.0)

View file

@ -54,7 +54,7 @@ versions do not work.
Build OpenSSL (version 3.5.0 or newer):
% git clone --quiet --depth=1 -b openssl-$OPENSSL_VERSION https://github.com/openssl/openssl
% git clone --depth 1 -b openssl-$OPENSSL_VERSION https://github.com/openssl/openssl
% cd openssl
% ./config --prefix=<somewhere1> --libdir=lib
% make

View file

@ -200,7 +200,7 @@ Building for Windows XP is required as a minimum.
You can build curl with:
- Microsoft Visual Studio 2008 v9.0 or later (`_MSC_VER >= 1500`)
- Microsoft Visual Studio 2010 v10.0 or later (`_MSC_VER >= 1600`)
- MinGW-w64 3.0 or later (`__MINGW64_VERSION_MAJOR >= 3`)
## Building Windows DLLs and C runtime (CRT) linkage issues
@ -650,7 +650,7 @@ This is a probably incomplete list of known CPU architectures and operating
systems that curl has been compiled for. If you know a system curl compiles
and runs on, that is not listed, please let us know.
## 109 Operating Systems
## 108 Operating Systems
AIX, AmigaOS, Android, ArcaOS, Aros, Atari FreeMiNT, Azure Sphere, BeOS,
Blackberry 10, Blackberry Tablet OS, Cell OS, Cesium, CheriBSD, Chrome OS,
@ -665,7 +665,7 @@ and runs on, that is not listed, please let us know.
SINIX-Z, SkyOS, SmartOS, Solaris, Sortix, SunOS, Syllable OS, Symbian,
Tizen, TPF, Tru64, tvOS, ucLinux, Ultrix, UNICOS, UnixWare, visionOS, VMS,
vxWorks, watchOS, Wear OS, WebOS, Wii System Software, Wii U, Windows,
Windows CE, Xbox System, Xenix, z/OS, z/TPF, z/VM, z/VSE, Zephyr
Xbox System, Xenix, z/OS, z/TPF, z/VM, z/VSE, Zephyr
## 28 CPU Architectures

View file

@ -24,7 +24,7 @@ versions of libs and build tools.
We aim to support these or later versions.
- OpenSSL 1.0.2a
- OpenSSL 3.0.0
- LibreSSL 2.9.1
- GnuTLS 3.1.10
- mbedTLS 3.2.0

View file

@ -361,7 +361,7 @@ Benjamin Sergeant
Ben Kohler
Ben Madsen
Ben Noordhuis
Benoit Neil
Benoit Neil (Sukender)
Benoit Pierre
Benoit Sigoure
Ben Van Hof
@ -3148,6 +3148,7 @@ Temprimus
Terence Eden
Terri Oda
Terry Wu
Tetetest
thanhchungbtc on github
TheAssassin on github
TheBitBrine
@ -3328,6 +3329,7 @@ UrsusArctos on github
User Sg
ustcqidi on github
Vadim Grinshpun
Vaibhav Kumar
Valentin David
Valentín Gutiérrez
Valentin Richter

View file

@ -15,6 +15,7 @@ Example:
- --limit-rate 100K $URL
- --limit-rate 1000 $URL
- --limit-rate 10M $URL
- --limit-rate 200K --max-time 60 $URL
---
# `--limit-rate`

View file

@ -103,12 +103,7 @@ int main(int argc, char **argv)
if(!fp)
return 2;
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
if(stat(file, &file_info) != 0) {
#else
if(fstat(fileno(fp), &file_info) != 0) {
#endif
fclose(fp);
return 1; /* cannot continue */
}
@ -152,7 +147,7 @@ int main(int argc, char **argv)
data twice!!! */
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
/* set user name and password for the authentication */
/* set username and password for the authentication */
curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
/* Now run off and do what you have been told! */

View file

@ -29,7 +29,7 @@
* filter IP addresses.
*/
#if defined(__AMIGA__) || defined(UNDER_CE)
#ifdef __AMIGA__
#include <stdio.h>
int main(void) { printf("Platform not supported.\n"); return 1; }
#else

View file

@ -40,7 +40,7 @@ int main(void)
/*
Each single string should be written using the format
HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT where HOST is the host of the
request, PORT is the port of the request, CONNECT-TO-HOST is the host name
request, PORT is the port of the request, CONNECT-TO-HOST is the hostname
to connect to, and CONNECT-TO-PORT is the port to connect to.
*/
/* instead of curl.se:443, it resolves and uses example.com:443 but in other
@ -53,12 +53,12 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_URL, "https://curl.se/");
/* since this connects to the wrong host, checking the host name in the
/* since this connects to the wrong host, checking the hostname in the
server certificate fails, so unless we disable the check libcurl
returns CURLE_PEER_FAILED_VERIFICATION */
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
/* Letting the wrong host name in the certificate be okay, the transfer
/* Letting the wrong hostname in the certificate be okay, the transfer
goes through but (most likely) causes a 404 or similar because it sends
an unknown name in the Host: header field */
res = curl_easy_perform(curl);

View file

@ -47,7 +47,7 @@ static int print_cookies(CURL *curl)
printf("Cookies, curl knows:\n");
res = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies);
if(res != CURLE_OK) {
fprintf(stderr, "Curl curl_easy_getinfo failed: %s\n",
fprintf(stderr, "curl curl_easy_getinfo failed: %s\n",
curl_easy_strerror(res));
return 1;
}
@ -85,7 +85,7 @@ main(void)
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* start cookie engine */
res = curl_easy_perform(curl);
if(res != CURLE_OK) {
fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res));
fprintf(stderr, "curl perform failed: %s\n", curl_easy_strerror(res));
return 1;
}
@ -105,7 +105,7 @@ main(void)
"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",
fprintf(stderr, "curl curl_easy_setopt failed: %s\n",
curl_easy_strerror(res));
return 1;
}
@ -120,7 +120,7 @@ main(void)
"expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.example.com");
res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline);
if(res != CURLE_OK) {
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n",
fprintf(stderr, "curl curl_easy_setopt failed: %s\n",
curl_easy_strerror(res));
return 1;
}
@ -129,14 +129,14 @@ main(void)
res = curl_easy_perform(curl);
if(res != CURLE_OK) {
fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res));
fprintf(stderr, "curl perform failed: %s\n", curl_easy_strerror(res));
return 1;
}
curl_easy_cleanup(curl);
}
else {
fprintf(stderr, "Curl init failed!\n");
fprintf(stderr, "curl init failed!\n");
return 1;
}

View file

@ -170,7 +170,7 @@ static size_t follow_links(CURLM *multi, struct memory *mem,
return count;
}
static int is_html(char *ctype)
static int is_html(const char *ctype)
{
return ctype != NULL && strlen(ctype) > 10 && strstr(ctype, "text/html");
}

View file

@ -69,7 +69,7 @@ static void dump(const char *text, FILE *stream, unsigned char *ptr,
}
fprintf(stream, "%c",
(ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
/* check again for 0D0A, to avoid an extra \n if it is at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
i += (c + 3 - width);

View file

@ -133,7 +133,7 @@ static void mcode_or_die(const char *where, CURLMcode code)
static void timer_cb(struct GlobalInfo *g, int revents);
/* Update the timer after curl_multi library does its thing. Curl informs the
/* Update the timer after curl_multi library does its thing. curl informs the
* application through this callback what it wants the new timeout to be,
* after it does some work. */
static int multi_timer_cb(CURLM *multi, long timeout_ms, struct GlobalInfo *g)
@ -219,7 +219,7 @@ static void timer_cb(struct GlobalInfo *g, int revents)
err = read(g->tfd, &count, sizeof(uint64_t));
if(err == -1) {
/* Note that we may call the timer callback even if the timerfd is not
* readable. It's possible that there are multiple events stored in the
* readable. It is possible that there are multiple events stored in the
* epoll buffer (i.e. the timer may have fired multiple times). The event
* count is cleared after the first call so future events in the epoll
* buffer fails to read from the timer. */

View file

@ -46,11 +46,7 @@
#include <unistd.h> /* misc. Unix functions */
#endif
#ifdef UNDER_CE
#define strerror(e) "?"
#else
#include <errno.h>
#endif
/* The IP address and port number to connect to */
#define IPADDR "127.0.0.1"

View file

@ -57,12 +57,7 @@ int main(void)
}
/* to get the file size */
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
if(stat("debugit", &file_info) != 0) {
#else
if(fstat(fileno(fd), &file_info) != 0) {
#endif
fclose(fd);
curl_global_cleanup();
return 1; /* cannot continue */

View file

@ -28,11 +28,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifdef UNDER_CE
#define strerror(e) "?"
#else
#include <errno.h>
#endif
#ifdef _WIN32
#include <io.h>
#undef stat
@ -90,17 +86,12 @@ int main(void)
/* get a FILE * of the file */
hd_src = fopen(LOCAL_FILE, "rb");
if(!hd_src) {
printf("Couldn't open '%s': %s\n", LOCAL_FILE, strerror(errno));
printf("Could not open '%s': %s\n", LOCAL_FILE, strerror(errno));
return 2;
}
/* to get the file size */
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
if(stat(LOCAL_FILE, &file_info) != 0) {
#else
if(fstat(fileno(hd_src), &file_info) != 0) {
#endif
fclose(hd_src);
return 1; /* cannot continue */
}

View file

@ -48,7 +48,7 @@ struct WriteThis {
static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
{
struct WriteThis *upload = (struct WriteThis *)userp;
size_t max = size*nmemb;
size_t max = size * nmemb;
if(max < 1)
return 0;

View file

@ -39,7 +39,7 @@ static size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb,
r = sscanf(ptr, "Content-Length: %ld\n", &len);
if(r == 1)
*((long *) stream) = len;
*((long *)stream) = len;
return size * nmemb;
}
@ -77,9 +77,7 @@ static int upload(CURL *curl, const char *remotepath,
f = fopen(localpath, "rb");
if(!f) {
#ifndef UNDER_CE
perror(NULL);
#endif
return 0;
}

View file

@ -430,9 +430,9 @@ int init_fifo(void)
int main(void)
{
struct GlobalInfo *g = g_malloc0(sizeof(struct GlobalInfo));
GMainLoop*gmain;
GMainLoop *gmain;
int fd;
GIOChannel* ch;
GIOChannel *ch;
CURLcode res = curl_global_init(CURL_GLOBAL_ALL);
if(res)

View file

@ -33,7 +33,7 @@ static size_t write_cb(char *data, size_t n, size_t l, void *userp)
/* take care of the data here, ignored in this example */
(void)data;
(void)userp;
return n*l;
return n * l;
}
int main(void)

View file

@ -50,7 +50,7 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent)
for(child = tidyGetChild(tnod); child; child = tidyGetNext(child) ) {
ctmbstr name = tidyNodeGetName(child);
if(name) {
/* if it has a name, then it's an HTML tag ... */
/* if it has a name, then it is an HTML tag ... */
TidyAttr attr;
printf("%*.*s%s ", indent, indent, "<", name);
/* walk the attribute list */
@ -62,7 +62,7 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent)
printf(">\n");
}
else {
/* if it does not have a name, then it's probably text, cdata, etc... */
/* if it does not have a name, then it is probably text, cdata, etc... */
TidyBuffer buf;
tidyBufInit(&buf);
tidyNodeGetText(doc, child, &buf);

View file

@ -22,7 +22,7 @@
*
***************************************************************************/
/* <DESC>
* Get a web page, extract the title with libxml.
* Get a webpage, extract the title with libxml.
* </DESC>
Written by Lars Nilsson

View file

@ -28,11 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef UNDER_CE
#define strerror(e) "?"
#else
#include <errno.h>
#endif
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
@ -90,7 +86,7 @@ static void dump(const char *text, int num, unsigned char *ptr,
}
fprintf(stderr, "%c",
(ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
/* check again for 0D0A, to avoid an extra \n if it is at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
i += (c + 3 - width);

View file

@ -78,7 +78,7 @@ static void dump(const char *text, unsigned char *ptr, size_t size, char nohex)
}
fprintf(stderr, "%c",
(ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
/* check again for 0D0A, to avoid an extra \n if it is at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
i += (c + 3 - width);

View file

@ -30,11 +30,7 @@
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#ifdef UNDER_CE
#define strerror(e) "?"
#else
#include <errno.h>
#endif
/* somewhat Unix-specific */
#ifndef _MSC_VER
@ -92,7 +88,7 @@ struct input {
int num;
};
static void dump(const char *text, int num, unsigned char *ptr,
static void dump(const char *text, int num, const unsigned char *ptr,
size_t size, char nohex)
{
size_t i;
@ -128,7 +124,7 @@ static void dump(const char *text, int num, unsigned char *ptr,
}
fprintf(stderr, "%c",
(ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
/* check again for 0D0A, to avoid an extra \n if it is at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
i += (c + 3 - width);
@ -231,14 +227,9 @@ static int setup(struct input *t, int num, const char *upload)
return 1;
}
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
if(stat(upload, &file_info) != 0) {
#else
if(fstat(fileno(t->in), &file_info) != 0) {
#endif
fprintf(stderr, "error: could not stat file %s: %s\n",
upload, strerror(errno));
fprintf(stderr, "error: could not stat file %s: %s\n", upload,
strerror(errno));
fclose(t->out);
t->out = NULL;
return 1;
@ -305,7 +296,7 @@ int main(int argc, char **argv)
num_transfers = 3; /* a suitable low default */
if(argc > 2)
/* if given a file name, upload this! */
/* if given a filename, upload this! */
filename = argv[2];
}
else

View file

@ -22,7 +22,7 @@
*
***************************************************************************/
/* <DESC>
* Very simple HTTP/3 GET
* Simple HTTP/3 GET
* </DESC>
*/
#include <stdio.h>

View file

@ -90,12 +90,7 @@ int main(int argc, char **argv)
return 2;
/* get the file size of the local file */
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
if(stat(file, &file_info) != 0) {
#else
if(fstat(fileno(hd_src), &file_info) != 0) {
#endif
fclose(hd_src);
return 1; /* cannot continue */
}

View file

@ -56,7 +56,7 @@ int main(void)
#ifdef SKIP_HOSTNAME_VERIFICATION
/*
* If the site you are connecting to uses a different host name that what
* If the site you are connecting to uses a different hostname that what
* they have mentioned in their server certificate's commonName (or
* subjectAltName) fields, libcurl refuses to connect. You can skip this
* check, but it makes the connection insecure.

View file

@ -68,7 +68,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif
/* If the site you are connecting to uses a different host name that what
/* If the site you are connecting to uses a different hostname that what
* they have mentioned in their server certificate's commonName (or
* subjectAltName) fields, libcurl refuses to connect. You can skip this
* check, but it makes the connection insecure. */

View file

@ -32,9 +32,7 @@
*
*/
#ifndef UNDER_CE
#include <errno.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
@ -140,8 +138,8 @@ static int mem_addf(struct mem *mem, const char *format, ...)
/* we need about 100 chars or less to write 95% of lines */
x = 128;
/* first try: there's probably enough memory to write everything.
second try: there's definitely enough memory to write everything. */
/* first try: there is probably enough memory to write everything.
second try: there is definitely enough memory to write everything. */
for(i = 0; i < 2; ++i) {
if(x < 0 || mem_need(mem, (size_t)x + 1) < 0)
break;
@ -156,7 +154,7 @@ static int mem_addf(struct mem *mem, const char *format, ...)
return x;
}
#if defined(_WIN32) && !defined(UNDER_CE)
#ifdef _WIN32
/* Not all versions of Windows CRT vsnprintf are compliant with C99. Some
return -1 if buffer too small. Try _vscprintf to get the needed size. */
if(!i && x < 0) {
@ -297,11 +295,9 @@ int main(void)
}
}
else {
#ifndef UNDER_CE
mem_addf(&t->log, "Failed to create body output file %s: %s\n",
t->bodyfile, strerror(errno));
fprintf(stderr, "%s", t->log.recent);
#endif
failed = 1;
}
@ -310,12 +306,10 @@ int main(void)
if(fp && t->log.len == fwrite(t->log.buf, 1, t->log.len, fp))
fprintf(stderr, "Transfer log written to %s\n", t->logfile);
#ifndef UNDER_CE
else {
fprintf(stderr, "Failed to write transfer log to %s: %s\n",
t->logfile, strerror(errno));
}
#endif
if(fp)
fclose(fp);

View file

@ -34,7 +34,7 @@
#define TRUE 1
static void dump(const char *text, FILE *stream, unsigned char *ptr,
static void dump(const char *text, FILE *stream, const unsigned char *ptr,
size_t size, char nohex)
{
size_t i;
@ -71,7 +71,7 @@ static void dump(const char *text, FILE *stream, unsigned char *ptr,
}
fprintf(stream, "%c",
(ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
/* check again for 0D0A, to avoid an extra \n if it is at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
i += (c + 3 - width);

View file

@ -51,7 +51,7 @@ int main(void)
CURL_IGNORE_DEPRECATION(
/* Fill in the file upload field. This makes libcurl load data from
the given file name when curl_easy_perform() is called. */
the given filename when curl_easy_perform() is called. */
curl_formadd(&formpost,
&lastptr,
CURLFORM_COPYNAME, "sendfile",

View file

@ -50,14 +50,19 @@ static const char * const urls[NUMT]= {
"www.example"
};
static void *pull_one_url(void *pindex)
struct targ {
const char *url;
};
static void *pull_one_url(void *p)
{
CURL *curl;
struct targ *targ = p;
curl = curl_easy_init();
if(curl) {
int i = *(int *)pindex;
curl_easy_setopt(curl, CURLOPT_URL, urls[i]);
curl_easy_setopt(curl, CURLOPT_URL, targ->url);
(void)curl_easy_perform(curl); /* ignores error */
curl_easy_cleanup(curl);
}
@ -76,6 +81,7 @@ int main(void)
{
CURLcode res;
pthread_t tid[NUMT];
struct targ targs[NUMT];
int i;
/* Must initialize libcurl before any threads are started */
@ -84,12 +90,14 @@ int main(void)
return (int)res;
for(i = 0; i < NUMT; i++) {
int error = pthread_create(&tid[i],
NULL, /* default attributes please */
pull_one_url,
(void *)&i);
int error;
targs[i].url = urls[i];
error = pthread_create(&tid[i],
NULL, /* default attributes please */
pull_one_url,
(void *)&targs[i]);
if(error)
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
fprintf(stderr, "Could not run thread number %d, errno %d\n", i, error);
else
fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]);
}

View file

@ -51,7 +51,7 @@ int main(void)
/* extract hostname from the parsed URL */
uc = curl_url_get(h, CURLUPART_HOST, &host, 0);
if(!uc) {
printf("Host name: %s\n", host);
printf("Hostname: %s\n", host);
curl_free(host);
}

View file

@ -67,7 +67,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif
/* If the site you are connecting to uses a different host name that what
/* If the site you are connecting to uses a different hostname that what
* they have mentioned in their server certificate's commonName (or
* subjectAltName) fields, libcurl refuses to connect. You can skip this
* check, but it makes the connection insecure. */

View file

@ -22,7 +22,7 @@
*
***************************************************************************/
/* <DESC>
* Very simple RTSP request sending OPTIONS.
* Simple RTSP request sending OPTIONS.
* </DESC>
*/
#include <stdio.h>

View file

@ -92,9 +92,7 @@ static int sftpResumeUpload(CURL *curl, const char *remotepath,
f = fopen(localpath, "rb");
if(!f) {
#ifndef UNDER_CE
perror(NULL);
#endif
return 0;
}
@ -103,7 +101,7 @@ static int sftpResumeUpload(CURL *curl, const char *remotepath,
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb);
curl_easy_setopt(curl, CURLOPT_READDATA, f);
#if defined(_WIN32) && !defined(UNDER_CE)
#ifdef _WIN32
_fseeki64(f, remoteFileSizeByte, SEEK_SET);
#else
fseek(f, (long)remoteFileSizeByte, SEEK_SET);

View file

@ -22,7 +22,7 @@
*
***************************************************************************/
/* <DESC>
* Very simple HTTP GET
* Simple HTTP GET
* </DESC>
*/
#include <stdio.h>

View file

@ -22,7 +22,7 @@
*
***************************************************************************/
/* <DESC>
* Very simple HTTP POST
* Simple HTTP POST
* </DESC>
*/
#include <stdio.h>

View file

@ -133,7 +133,7 @@ void *create_thread(void *progress_bar)
pull_one_url,
NULL);
if(error)
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
fprintf(stderr, "Could not run thread number %d, errno %d\n", i, error);
else
fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]);
}

View file

@ -116,7 +116,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif
/* If the site you are connecting to uses a different host name that what
/* If the site you are connecting to uses a different hostname that what
* they have mentioned in their server certificate's commonName (or
* subjectAltName) fields, libcurl refuses to connect. You can skip this
* check, but it makes the connection insecure. */

View file

@ -91,7 +91,7 @@ int main(int argc, char **argv)
pull_one_url,
(void *)&i);
if(error)
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
fprintf(stderr, "Could not run thread number %d, errno %d\n", i, error);
else
fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]);
}

View file

@ -42,7 +42,7 @@ int main(void)
if(res)
return (int)res;
/* init Curl URL */
/* init curl URL */
urlp = curl_url();
uc = curl_url_set(urlp, CURLUPART_URL,
"http://example.com/path/index.html", 0);

View file

@ -85,8 +85,7 @@ int main(void)
break;
}
/* if there are still transfers, loop */
} while(still_running);
} while(still_running); /* if there are still transfers, loop */
}
}
~~~

View file

@ -504,7 +504,7 @@ Features testable here are:
- `large-size` (size_t is larger than 32-bit)
- `libssh2`
- `libssh`
- `oldlibssh` (versions before 0.9.4)
- `badlibssh` (libssh configuration incompatible with the test suite)
- `libz`
- `local-http`. The HTTP server runs on 127.0.0.1
- `manual`

View file

@ -135,21 +135,12 @@
# endif
#elif defined(UNDER_CE)
# ifdef __MINGW32CE__
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_SUFFIX_CURL_OFF_T LL
# define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_SOCKLEN_T int
# else
# define CURL_TYPEOF_CURL_OFF_T __int64
# define CURL_FORMAT_CURL_OFF_T "I64d"
# define CURL_FORMAT_CURL_OFF_TU "I64u"
# define CURL_SUFFIX_CURL_OFF_T i64
# define CURL_SUFFIX_CURL_OFF_TU ui64
# define CURL_TYPEOF_CURL_SOCKLEN_T int
# endif
# define CURL_TYPEOF_CURL_OFF_T __int64
# define CURL_FORMAT_CURL_OFF_T "I64d"
# define CURL_FORMAT_CURL_OFF_TU "I64u"
# define CURL_SUFFIX_CURL_OFF_T i64
# define CURL_SUFFIX_CURL_OFF_TU ui64
# define CURL_TYPEOF_CURL_SOCKLEN_T int
#elif defined(__MINGW32__)
# include <inttypes.h>

View file

@ -559,7 +559,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
}
}
else {
/* IPv6 host name */
/* IPv6 hostname */
if(curlx_str_until(&p, &dsthost, MAX_IPADR_LEN, ']') ||
curlx_str_single(&p, ']')) {
infof(data, "Bad alt-svc IPv6 hostname, ignoring.");

View file

@ -473,7 +473,7 @@ static bool async_thrdd_init(struct Curl_easy *data,
err_exit:
CURL_TRC_DNS(data, "resolve thread failed init: %d", err);
async_thrdd_destroy(data);
CURL_SETERRNO(err);
errno = err;
return FALSE;
}

View file

@ -311,7 +311,7 @@ static CURLcode cf_h2_proxy_ctx_init(struct Curl_cfilter *cf,
rc = nghttp2_session_callbacks_new(&cbs);
if(rc) {
failf(data, "Couldn't initialize nghttp2 callbacks");
failf(data, "Could not initialize nghttp2 callbacks");
goto out;
}
@ -331,7 +331,7 @@ static CURLcode cf_h2_proxy_ctx_init(struct Curl_cfilter *cf,
/* The nghttp2 session is not yet setup, do it */
rc = proxy_h2_client_new(cf, cbs);
if(rc) {
failf(data, "Couldn't initialize nghttp2");
failf(data, "Could not initialize nghttp2");
goto out;
}

View file

@ -103,7 +103,9 @@ static void set_ipv6_v6only(curl_socket_t sockfd, int on)
#define set_ipv6_v6only(x,y)
#endif
static void tcpnodelay(struct Curl_easy *data, curl_socket_t sockfd)
static void tcpnodelay(struct Curl_cfilter *cf,
struct Curl_easy *data,
curl_socket_t sockfd)
{
#if defined(TCP_NODELAY) && defined(CURL_TCP_NODELAY_SUPPORTED)
curl_socklen_t onoff = (curl_socklen_t) 1;
@ -112,9 +114,10 @@ static void tcpnodelay(struct Curl_easy *data, curl_socket_t sockfd)
if(setsockopt(sockfd, level, TCP_NODELAY,
(void *)&onoff, sizeof(onoff)) < 0)
infof(data, "Could not set TCP_NODELAY: %s",
curlx_strerror(SOCKERRNO, buffer, sizeof(buffer)));
CURL_TRC_CF(data, cf, "Could not set TCP_NODELAY: %s",
curlx_strerror(SOCKERRNO, buffer, sizeof(buffer)));
#else
(void)cf;
(void)data;
(void)sockfd;
#endif
@ -125,31 +128,28 @@ static void tcpnodelay(struct Curl_easy *data, curl_socket_t sockfd)
sending data to a dead peer (instead of relying on the 4th argument to send
being MSG_NOSIGNAL). Possibly also existing and in use on other BSD
systems? */
static void nosigpipe(struct Curl_easy *data,
static void nosigpipe(struct Curl_cfilter *cf,
struct Curl_easy *data,
curl_socket_t sockfd)
{
int onoff = 1;
(void)data;
if(setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE,
(void *)&onoff, sizeof(onoff)) < 0) {
#ifndef CURL_DISABLE_VERBOSE_STRINGS
char buffer[STRERROR_LEN];
infof(data, "Could not set SO_NOSIGPIPE: %s",
curlx_strerror(SOCKERRNO, buffer, sizeof(buffer)));
CURL_TRC_CF(data, cf, "Could not set SO_NOSIGPIPE: %s",
curlx_strerror(SOCKERRNO, buffer, sizeof(buffer)));
#else
(void)cf;
(void)data;
#endif
}
}
#else
#define nosigpipe(x,y) Curl_nop_stmt
#define nosigpipe(x,y,z) Curl_nop_stmt
#endif
#if defined(USE_WINSOCK) && \
defined(TCP_KEEPIDLE) && defined(TCP_KEEPINTVL) && defined(TCP_KEEPCNT)
/* Win 10, v 1709 (10.0.16299) and later can use SetSockOpt TCP_KEEP____
* so should use seconds */
#define CURL_WINSOCK_KEEP_SSO
#define KEEPALIVE_FACTOR(x)
#elif defined(USE_WINSOCK) || \
#if defined(USE_WINSOCK) || \
(defined(__sun) && !defined(TCP_KEEPIDLE)) || \
(defined(__DragonFly__) && __DragonFly_version < 500702) || \
(defined(_WIN32) && !defined(TCP_KEEPIDLE))
@ -160,19 +160,9 @@ static void nosigpipe(struct Curl_easy *data,
#define KEEPALIVE_FACTOR(x)
#endif
/* Offered by mingw-w64 and MS SDK. Latter only when targeting Win7+. */
#if defined(USE_WINSOCK) && !defined(SIO_KEEPALIVE_VALS)
#define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4)
struct tcp_keepalive {
u_long onoff;
u_long keepalivetime;
u_long keepaliveinterval;
};
#endif
static void
tcpkeepalive(struct Curl_easy *data,
tcpkeepalive(struct Curl_cfilter *cf,
struct Curl_easy *data,
curl_socket_t sockfd)
{
int optval = data->set.tcp_keepalive ? 1 : 0;
@ -180,62 +170,72 @@ tcpkeepalive(struct Curl_easy *data,
/* only set IDLE and INTVL if setting KEEPALIVE is successful */
if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE,
(void *)&optval, sizeof(optval)) < 0) {
infof(data, "Failed to set SO_KEEPALIVE on fd "
"%" FMT_SOCKET_T ": errno %d",
sockfd, SOCKERRNO);
CURL_TRC_CF(data, cf, "Failed to set SO_KEEPALIVE on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
else {
#ifdef SIO_KEEPALIVE_VALS /* Windows */
/* Windows 10, version 1709 (10.0.16299) and later versions */
#ifdef CURL_WINSOCK_KEEP_SSO
optval = curlx_sltosi(data->set.tcp_keepidle);
KEEPALIVE_FACTOR(optval);
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE,
(const char *)&optval, sizeof(optval)) < 0) {
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 = (u_long)optval;
optval = curlx_sltosi(data->set.tcp_keepintvl);
KEEPALIVE_FACTOR(optval);
vals.keepaliveinterval = (u_long)optval;
if(WSAIoctl(sockfd, SIO_KEEPALIVE_VALS, (LPVOID) &vals, sizeof(vals),
NULL, 0, &dummy, NULL, NULL) != 0) {
infof(data, "Failed to set SIO_KEEPALIVE_VALS on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
#ifdef USE_WINSOCK
/* Offered by mingw-w64 v12+. MS SDK ~10+/~VS2017+. */
#if defined(TCP_KEEPIDLE) && defined(TCP_KEEPINTVL) && defined(TCP_KEEPCNT)
/* Windows 10, version 1709 (10.0.16299) and later versions can use
setsockopt() TCP_KEEP*. Older versions return with failure. */
if(curlx_verify_windows_version(10, 0, 16299, PLATFORM_WINNT,
VERSION_GREATER_THAN_EQUAL)) {
CURL_TRC_CF(data, cf, "Set TCP_KEEP* on fd=%" FMT_SOCKET_T, sockfd);
optval = curlx_sltosi(data->set.tcp_keepidle);
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE,
(const char *)&optval, sizeof(optval)) < 0) {
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPIDLE on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
optval = curlx_sltosi(data->set.tcp_keepintvl);
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL,
(const char *)&optval, sizeof(optval)) < 0) {
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPINTVL on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
optval = curlx_sltosi(data->set.tcp_keepcnt);
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT,
(const char *)&optval, sizeof(optval)) < 0) {
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPCNT on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
}
else
#endif /* TCP_KEEPIDLE && TCP_KEEPINTVL && TCP_KEEPCNT */
{
/* Offered by mingw-w64 and MS SDK. Latter only when targeting Win7+. */
#ifndef SIO_KEEPALIVE_VALS
#define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4)
struct tcp_keepalive {
u_long onoff;
u_long keepalivetime;
u_long keepaliveinterval;
};
#endif
#else /* !Windows */
struct tcp_keepalive vals;
DWORD dummy;
vals.onoff = 1;
optval = curlx_sltosi(data->set.tcp_keepidle);
KEEPALIVE_FACTOR(optval);
vals.keepalivetime = (u_long)optval;
optval = curlx_sltosi(data->set.tcp_keepintvl);
KEEPALIVE_FACTOR(optval);
vals.keepaliveinterval = (u_long)optval;
if(WSAIoctl(sockfd, SIO_KEEPALIVE_VALS, (LPVOID)&vals, sizeof(vals),
NULL, 0, &dummy, NULL, NULL) != 0) {
CURL_TRC_CF(data, cf, "Failed to set SIO_KEEPALIVE_VALS on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
}
#else /* !USE_WINSOCK */
#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 "
"%" FMT_SOCKET_T ": errno %d",
sockfd, SOCKERRNO);
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPIDLE on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
#elif defined(TCP_KEEPALIVE)
/* macOS style */
@ -243,9 +243,8 @@ tcpkeepalive(struct Curl_easy *data,
KEEPALIVE_FACTOR(optval);
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE,
(void *)&optval, sizeof(optval)) < 0) {
infof(data, "Failed to set TCP_KEEPALIVE on fd "
"%" FMT_SOCKET_T ": errno %d",
sockfd, SOCKERRNO);
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
#elif defined(TCP_KEEPALIVE_THRESHOLD)
/* Solaris <11.4 style */
@ -253,9 +252,8 @@ tcpkeepalive(struct Curl_easy *data,
KEEPALIVE_FACTOR(optval);
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE_THRESHOLD,
(void *)&optval, sizeof(optval)) < 0) {
infof(data, "Failed to set TCP_KEEPALIVE_THRESHOLD on fd "
"%" FMT_SOCKET_T ": errno %d",
sockfd, SOCKERRNO);
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE_THRESHOLD on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
#endif
#ifdef TCP_KEEPINTVL
@ -263,9 +261,8 @@ tcpkeepalive(struct Curl_easy *data,
KEEPALIVE_FACTOR(optval);
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL,
(void *)&optval, sizeof(optval)) < 0) {
infof(data, "Failed to set TCP_KEEPINTVL on fd "
"%" FMT_SOCKET_T ": errno %d",
sockfd, SOCKERRNO);
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPINTVL on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
#elif defined(TCP_KEEPALIVE_ABORT_THRESHOLD)
/* Solaris <11.4 style */
@ -284,19 +281,19 @@ tcpkeepalive(struct Curl_easy *data,
KEEPALIVE_FACTOR(optval);
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE_ABORT_THRESHOLD,
(void *)&optval, sizeof(optval)) < 0) {
infof(data, "Failed to set TCP_KEEPALIVE_ABORT_THRESHOLD on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE_ABORT_THRESHOLD"
" on fd %" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
#endif
#ifdef TCP_KEEPCNT
optval = curlx_sltosi(data->set.tcp_keepcnt);
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT,
(void *)&optval, sizeof(optval)) < 0) {
infof(data, "Failed to set TCP_KEEPCNT on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPCNT on fd "
"%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
#endif
#endif
#endif /* USE_WINSOCK */
}
}
@ -657,7 +654,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
/* Do not fall back to treating it as a hostname */
char buffer[STRERROR_LEN];
data->state.os_errno = error = SOCKERRNO;
failf(data, "Couldn't bind to interface '%s' with errno %d: %s",
failf(data, "Could not bind to interface '%s' with errno %d: %s",
iface, error, curlx_strerror(error, buffer, sizeof(buffer)));
return CURLE_INTERFACE_FAILED;
}
@ -761,7 +758,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
char buffer[STRERROR_LEN];
data->state.errorbuf = FALSE;
data->state.os_errno = error = SOCKERRNO;
failf(data, "Couldn't bind to '%s' with errno %d: %s", host,
failf(data, "Could not bind to '%s' with errno %d: %s", host,
error, curlx_strerror(error, buffer, sizeof(buffer)));
return CURLE_INTERFACE_FAILED;
}
@ -846,24 +843,11 @@ static bool verifyconnect(curl_socket_t sockfd, int *error)
*
* Someone got to verify this on Win-NT 4.0, 2000."
*/
#ifdef UNDER_CE
Sleep(0);
#else
SleepEx(0, FALSE);
#endif
#endif
if(getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void *)&err, &errSize))
err = SOCKERRNO;
#ifdef UNDER_CE
/* Old Windows CE versions do not support SO_ERROR */
if(WSAENOPROTOOPT == err) {
SET_SOCKERRNO(0);
err = 0;
}
#endif
#if defined(EBADIOCTL) && defined(__minix)
/* Minix 3.1.x does not support getsockopt on UDP sockets */
if(EBADIOCTL == err) {
@ -1150,14 +1134,14 @@ static CURLcode cf_socket_open(struct Curl_cfilter *cf,
ctx->addr.socktype == SOCK_STREAM;
#endif
if(is_tcp && data->set.tcp_nodelay)
tcpnodelay(data, ctx->sock);
tcpnodelay(cf, data, ctx->sock);
nosigpipe(data, ctx->sock);
nosigpipe(cf, data, ctx->sock);
Curl_sndbuf_init(ctx->sock);
if(is_tcp && data->set.tcp_keepalive)
tcpkeepalive(data, ctx->sock);
tcpkeepalive(cf, data, ctx->sock);
if(data->set.fsockopt) {
/* activate callback for setting socket options */
@ -1271,8 +1255,8 @@ static int do_connect(struct Curl_cfilter *cf, struct Curl_easy *data,
#elif defined(TCP_FASTOPEN_CONNECT) /* Linux >= 4.11 */
if(setsockopt(ctx->sock, IPPROTO_TCP, TCP_FASTOPEN_CONNECT,
(void *)&optval, sizeof(optval)) < 0)
infof(data, "Failed to enable TCP Fast Open on fd %" FMT_SOCKET_T,
ctx->sock);
CURL_TRC_CF(data, cf, "Failed to enable TCP Fast Open on fd %"
FMT_SOCKET_T, ctx->sock);
rc = connect(ctx->sock, &ctx->addr.curl_sa_addr, ctx->addr.addrlen);
#elif defined(MSG_FASTOPEN) /* old Linux */

View file

@ -28,8 +28,6 @@
/* Hand crafted config file for Windows */
/* ================================================================ */
#ifndef UNDER_CE
/* Define some minimum and default build targets for Visual Studio */
#ifdef _MSC_VER
/* VS2012 default target settings and minimum build target check. */
@ -58,28 +56,25 @@
# error VS2012 does not support build targets prior to Windows Vista
# endif
# endif
/* Default target settings and minimum build target check for
VS2008 and VS2010 */
/* VS2010 default target settings and minimum build target check. */
# else
# define VS2008_MIN_TARGET 0x0501 /* XP */
/* VS2008 default build target is Windows Vista (0x0600).
/* VS2010 default build target is Windows 7 (0x0601).
We override default target to be Windows XP. */
# define VS2008_DEF_TARGET 0x0501 /* XP */
# define VS2010_MIN_TARGET 0x0501 /* XP */
# define VS2010_DEF_TARGET 0x0501 /* XP */
# ifndef _WIN32_WINNT
# define _WIN32_WINNT VS2008_DEF_TARGET
# define _WIN32_WINNT VS2010_DEF_TARGET
# endif
# ifndef WINVER
# define WINVER VS2008_DEF_TARGET
# define WINVER VS2010_DEF_TARGET
# endif
# if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET)
# error VS2008 does not support build targets prior to Windows XP
# if (_WIN32_WINNT < VS2010_MIN_TARGET) || (WINVER < VS2010_MIN_TARGET)
# error VS2010 does not support build targets prior to Windows XP
# endif
# endif
#endif /* _MSC_VER */
#endif /* UNDER_CE */
/* ---------------------------------------------------------------- */
/* HEADER FILES */
/* ---------------------------------------------------------------- */
@ -87,19 +82,15 @@
/* Define if you have the <arpa/inet.h> header file. */
/* #define HAVE_ARPA_INET_H 1 */
#ifndef UNDER_CE
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1 /* exists on __MINGW32CE__ */
#define HAVE_FCNTL_H 1
/* Define if you have the <io.h> header file. */
#define HAVE_IO_H 1 /* exists on __MINGW32CE__ */
#define HAVE_IO_H 1
/* Define if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
#endif
/* Define if you have the <netdb.h> header file. */
/* #define HAVE_NETDB_H 1 */
@ -107,14 +98,12 @@
/* #define HAVE_NETINET_IN_H 1 */
/* Define to 1 if you have the <stdbool.h> header file. */
#ifndef UNDER_CE
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
#define HAVE_STDBOOL_H 1 /* exists on __MINGW32CE__ */
#endif
#define HAVE_STDBOOL_H 1
#endif
/* Define to 1 if you have the <stdint.h> header file. */
#if (defined(_MSC_VER) && (_MSC_VER >= 1600)) || defined(__MINGW32__)
#if defined(_MSC_VER) || defined(__MINGW32__)
#define HAVE_STDINT_H 1
#endif
@ -159,10 +148,8 @@
#define STDC_HEADERS 1
/* Define to 1 if bool is an available type. */
#ifndef UNDER_CE
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
#define HAVE_BOOL_T 1 /* exists on __MINGW32CE__ */
#endif
#define HAVE_BOOL_T 1
#endif
/* ---------------------------------------------------------------- */
@ -200,7 +187,6 @@
/* Define if you have the select function. */
#define HAVE_SELECT 1
#ifndef UNDER_CE
/* Define if you have the setlocale function. */
#define HAVE_SETLOCALE 1
@ -209,7 +195,6 @@
/* Define if you have the _setmode function. */
#define HAVE__SETMODE 1
#endif
/* Define if you have the socket function. */
#define HAVE_SOCKET 1
@ -276,9 +261,7 @@
#endif
/* Define to 1 if you have the signal function. */
#ifndef UNDER_CE
#define HAVE_SIGNAL 1
#endif
/* ---------------------------------------------------------------- */
/* TYPEDEF REPLACEMENTS */
@ -347,11 +330,9 @@
#endif
/* Windows XP is required for freeaddrinfo, getaddrinfo */
#ifndef UNDER_CE
#define HAVE_FREEADDRINFO 1
#define HAVE_GETADDRINFO 1
#define HAVE_GETADDRINFO_THREADSAFE 1
#endif
/* ---------------------------------------------------------------- */
/* STRUCT RELATED */
@ -370,8 +351,6 @@
/* LARGE FILE SUPPORT */
/* ---------------------------------------------------------------- */
#ifndef UNDER_CE
#if defined(_MSC_VER) || defined(__MINGW32__)
# define USE_WIN32_LARGE_FILES
/* Number of bits in a file offset, on hosts where this is settable. */
@ -390,8 +369,6 @@
# define SIZEOF_OFF_T 4
#endif
#endif /* UNDER_CE */
/* ---------------------------------------------------------------- */
/* DNS RESOLVER SPECIALTY */
/* ---------------------------------------------------------------- */
@ -420,7 +397,7 @@
#ifdef CURL_HAS_OPENLDAP_LDAPSDK
#undef USE_WIN32_LDAP
#define HAVE_LDAP_URL_PARSE 1
#elif !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE)
#elif !defined(CURL_WINDOWS_UWP)
#undef HAVE_LDAP_URL_PARSE
#define HAVE_LDAP_SSL 1
#define USE_WIN32_LDAP 1
@ -432,9 +409,7 @@
#endif
/* Define to use Unix sockets. */
#ifndef UNDER_CE
#define USE_UNIX_SOCKETS
#endif
/* ---------------------------------------------------------------- */
/* ADDITIONAL DEFINITIONS */
@ -442,52 +417,19 @@
/* Define cpu-machine-OS */
#ifndef CURL_OS
# ifdef UNDER_CE
# ifdef _M_ARM
# define CURL_OS "arm-pc-win32ce"
# else
# define CURL_OS "i386-pc-win32ce"
# endif
# else /* !UNDER_CE */
# if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */
# define CURL_OS "i386-pc-win32"
# elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (VS2005+ or gcc) */
# define CURL_OS "x86_64-pc-win32"
# elif defined(_M_IA64) || defined(__ia64__) /* Itanium */
# define CURL_OS "ia64-pc-win32"
# elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 */
# define CURL_OS "thumbv7a-pc-win32"
# elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */
# define CURL_OS "aarch64-pc-win32"
# else
# define CURL_OS "unknown-pc-win32"
# endif
# endif /* UNDER_CE */
# if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */
# define CURL_OS "i386-pc-win32"
# elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (VS2005+ or gcc) */
# define CURL_OS "x86_64-pc-win32"
# elif defined(_M_IA64) || defined(__ia64__) /* Itanium */
# define CURL_OS "ia64-pc-win32"
# elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 */
# define CURL_OS "thumbv7a-pc-win32"
# elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */
# define CURL_OS "aarch64-pc-win32"
# else
# define CURL_OS "unknown-pc-win32"
# endif
#endif /* !CURL_OS */
/* ---------------------------------------------------------------- */
/* Windows CE */
/* ---------------------------------------------------------------- */
#ifdef UNDER_CE
#ifndef UNICODE
#define UNICODE
#endif
#ifndef _UNICODE
#define _UNICODE
#endif
#define CURL_DISABLE_FILE 1
#define CURL_DISABLE_TELNET 1
#define CURL_DISABLE_LDAP 1
#ifndef _MSC_VER
/* !checksrc! disable BANNEDFUNC 1 */
extern int stat(const char *path, struct stat *buffer);
#endif
#endif /* UNDER_CE */
#endif /* HEADER_CURL_CONFIG_WIN32_H */

View file

@ -116,6 +116,7 @@ timediff_t Curl_timeleft_ms(struct Curl_easy *data,
{
timediff_t timeleft_ms = 0;
timediff_t ctimeleft_ms = 0;
timediff_t ctimeout_ms;
struct curltime now;
/* The duration of a connect and the total transfer are calculated from two
@ -136,20 +137,19 @@ timediff_t Curl_timeleft_ms(struct Curl_easy *data,
curlx_timediff_ms(*nowp, data->progress.t_startop);
if(!timeleft_ms)
timeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */
if(!duringconnect)
return timeleft_ms; /* no connect check, this is it */
}
if(duringconnect) {
timediff_t ctimeout_ms = (data->set.connecttimeout > 0) ?
data->set.connecttimeout : DEFAULT_CONNECT_TIMEOUT;
ctimeleft_ms = ctimeout_ms -
curlx_timediff_ms(*nowp, data->progress.t_startsingle);
if(!ctimeleft_ms)
ctimeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */
if(!timeleft_ms)
return ctimeleft_ms; /* no general timeout, this is it */
}
if(!duringconnect)
return timeleft_ms; /* no connect check, this is it */
ctimeout_ms = (data->set.connecttimeout > 0) ?
data->set.connecttimeout : DEFAULT_CONNECT_TIMEOUT;
ctimeleft_ms = ctimeout_ms -
curlx_timediff_ms(*nowp, data->progress.t_startsingle);
if(!ctimeleft_ms)
ctimeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */
if(!timeleft_ms)
return ctimeleft_ms; /* no general timeout, this is it */
/* return minimal time left or max amount already expired */
return (ctimeleft_ms < timeleft_ms) ? ctimeleft_ms : timeleft_ms;
}
@ -280,7 +280,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
addr[0] = '\0';
*port = 0;
CURL_SETERRNO(SOCKEAFNOSUPPORT);
errno = SOCKEAFNOSUPPORT;
return FALSE;
}

View file

@ -458,7 +458,7 @@ parse_cookie_header(struct Curl_easy *data,
*/
if(!co->name) {
/* The very first name/value pair is the actual cookie name */
/* The first name/value pair is the actual cookie name */
if(!sep)
/* Bad name/value pair. */
return CURLE_OK;

View file

@ -101,14 +101,7 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename,
*fh = curlx_fopen(filename, FOPEN_WRITETEXT);
if(!*fh)
goto fail;
if(
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
stat(filename, &sb) == -1
#else
fstat(fileno(*fh), &sb) == -1
#endif
|| !S_ISREG(sb.st_mode)) {
if(fstat(fileno(*fh), &sb) == -1 || !S_ISREG(sb.st_mode)) {
return CURLE_OK;
}
curlx_fclose(*fh);

View file

@ -62,7 +62,7 @@ int Curl_gethostname(char * const name, GETHOSTNAME_TYPE_ARG2 namelen)
if(strlen(force_hostname) < (size_t)namelen)
strcpy(name, force_hostname);
else
return 1; /* can't do it */
return 1; /* cannot do it */
err = 0;
}
else {

View file

@ -469,13 +469,13 @@ static void time2filetime(struct ms_filetime *ft, time_t t)
{
#if SIZEOF_TIME_T > 4
t = (t + (curl_off_t)11644473600) * 10000000;
ft->dwLowDateTime = (unsigned int) (t & 0xFFFFFFFF);
ft->dwHighDateTime = (unsigned int) (t >> 32);
ft->dwLowDateTime = (unsigned int)(t & 0xFFFFFFFF);
ft->dwHighDateTime = (unsigned int)(t >> 32);
#else
unsigned int r, s;
unsigned int i;
ft->dwLowDateTime = (unsigned int)t & 0xFFFFFFFF;
ft->dwLowDateTime = (unsigned int)(t & 0xFFFFFFFF);
ft->dwHighDateTime = 0;
# ifndef HAVE_TIME_T_UNSIGNED

View file

@ -96,7 +96,7 @@ unsigned short Curl_sasl_decode_mech(const char *ptr, size_t maxlen,
for(i = 0; mechtable[i].name; i++) {
if(maxlen >= mechtable[i].len &&
!memcmp(ptr, mechtable[i].name, mechtable[i].len)) {
curl_strnequal(ptr, mechtable[i].name, mechtable[i].len)) {
if(len)
*len = mechtable[i].len;

View file

@ -75,14 +75,14 @@
#endif
#endif
#if defined(__MINGW32__) && !defined(__MINGW32CE__) && \
#if defined(__MINGW32__) && \
(!defined(__MINGW64_VERSION_MAJOR) || (__MINGW64_VERSION_MAJOR < 3))
#error "Building curl requires mingw-w64 3.0 or later"
#endif
/* Visual Studio 2008 is the minimum Visual Studio version we support.
/* Visual Studio 2010 is the minimum Visual Studio version we support.
Workarounds for older versions of Visual Studio have been removed. */
#if defined(_MSC_VER) && (_MSC_VER < 1500)
#if defined(_MSC_VER) && (_MSC_VER < 1600)
#error "Ancient versions of Visual Studio are no longer supported due to bugs."
#endif
@ -122,14 +122,6 @@
# endif
#endif
/* Avoid bogus format check warnings with mingw32ce gcc 4.4.0 in
C99 (-std=gnu99) mode */
#if defined(__MINGW32CE__) && !defined(CURL_NO_FMT_CHECKS) && \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) && \
(defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 4))
#define CURL_NO_FMT_CHECKS
#endif
/* Compatibility */
#ifdef ENABLE_IPV6
#define USE_IPV6 1
@ -497,12 +489,10 @@
# define LSEEK_ERROR (__int64)-1
# else
/* Small file (<2Gb) support using Win32 functions. */
# ifndef UNDER_CE
# undef lseek
# define lseek(fdes, offset, whence) _lseek(fdes, (long)offset, whence)
# define fstat(fdes, stp) _fstat(fdes, stp)
# define struct_stat struct _stat
# endif
# undef lseek
# define lseek(fdes, offset, whence) _lseek(fdes, (long)offset, whence)
# define fstat(fdes, stp) _fstat(fdes, stp)
# define struct_stat struct _stat
# define LSEEK_ERROR (long)-1
# endif
#elif defined(__DJGPP__)
@ -817,27 +807,6 @@
#include "curl_setup_once.h"
#endif
#ifdef UNDER_CE
#define getenv curl_getenv /* Windows CE does not support getenv() */
#define raise(s) ((void)(s))
/* Terrible workarounds to make Windows CE compile */
#define errno 0
#define CURL_SETERRNO(x) ((void)(x))
#define EINTR 4
#define EAGAIN 11
#define ENOMEM 12
#define EACCES 13
#define EEXIST 17
#define EISDIR 21
#define EINVAL 22
#define ENOSPC 28
#define strerror(x) "?"
#undef STDIN_FILENO
#define STDIN_FILENO 0
#else
#define CURL_SETERRNO(x) (errno = (x))
#endif
/*
* Definition of our NOP statement Object-like macro
*/
@ -926,7 +895,7 @@ endings either CRLF or LF so 't' is appropriate.
/* for systems that do not detect this in configure */
#ifndef CURL_SA_FAMILY_T
# if defined(_WIN32) && !defined(UNDER_CE)
# ifdef _WIN32
# define CURL_SA_FAMILY_T ADDRESS_FAMILY
# elif defined(HAVE_SA_FAMILY_T)
# define CURL_SA_FAMILY_T sa_family_t

View file

@ -33,9 +33,7 @@
#include <string.h>
#include <stdarg.h>
#include <time.h>
#ifndef UNDER_CE
#include <errno.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@ -67,8 +65,6 @@
Use it for APIs that do not or cannot support the const qualifier. */
#ifdef HAVE_STDINT_H
# define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
#elif defined(_WIN32) /* for VS2008 */
# define CURL_UNCONST(p) ((void *)(ULONG_PTR)(const void *)(p))
#else
# define CURL_UNCONST(p) ((void *)(p)) /* Fall back to simple cast */
#endif
@ -356,7 +352,7 @@ typedef unsigned int bit;
#ifdef __VMS
#define argv_item_t __char_ptr32
#elif defined(_UNICODE) && !defined(UNDER_CE)
#elif defined(_UNICODE)
#define argv_item_t wchar_t *
#else
#define argv_item_t char *

View file

@ -40,10 +40,8 @@
#ifdef USE_OPENSSL
# include <openssl/opensslv.h>
# if (!defined(LIBRESSL_VERSION_NUMBER) && \
OPENSSL_VERSION_NUMBER >= 0x10101000L) || \
(defined(LIBRESSL_VERSION_NUMBER) && \
LIBRESSL_VERSION_NUMBER >= 0x3080000fL)
# if !defined(LIBRESSL_VERSION_NUMBER) || \
(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x3080000fL)
# include <openssl/opensslconf.h>
# if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA512)
# include <openssl/evp.h>

View file

@ -62,11 +62,7 @@ CURLcode Curl_sspi_global_init(void)
/* If security interface is not yet initialized try to do this */
if(!Curl_pSecFn) {
/* Get pointer to Security Service Provider Interface dispatch table */
#ifdef __MINGW32CE__
Curl_pSecFn = InitSecurityInterfaceW();
#else
Curl_pSecFn = InitSecurityInterface();
#endif
if(!Curl_pSecFn)
return CURLE_FAILED_INIT;
}

View file

@ -70,225 +70,6 @@ extern PSecurityFunctionTable Curl_pSecFn;
#define ISC_REQ_USE_HTTP_STYLE 0x01000000
#endif
#ifdef __MINGW32CE__
#ifndef ISC_RET_REPLAY_DETECT
#define ISC_RET_REPLAY_DETECT 0x00000004
#endif
#ifndef ISC_RET_SEQUENCE_DETECT
#define ISC_RET_SEQUENCE_DETECT 0x00000008
#endif
#ifndef ISC_RET_CONFIDENTIALITY
#define ISC_RET_CONFIDENTIALITY 0x00000010
#endif
#ifndef ISC_RET_ALLOCATED_MEMORY
#define ISC_RET_ALLOCATED_MEMORY 0x00000100
#endif
#ifndef ISC_RET_STREAM
#define ISC_RET_STREAM 0x00008000
#endif
#ifndef SEC_E_INSUFFICIENT_MEMORY
#define SEC_E_INSUFFICIENT_MEMORY ((HRESULT)0x80090300L)
#endif
#ifndef SEC_E_INVALID_HANDLE
#define SEC_E_INVALID_HANDLE ((HRESULT)0x80090301L)
#endif
#ifndef SEC_E_UNSUPPORTED_FUNCTION
#define SEC_E_UNSUPPORTED_FUNCTION ((HRESULT)0x80090302L)
#endif
#ifndef SEC_E_TARGET_UNKNOWN
#define SEC_E_TARGET_UNKNOWN ((HRESULT)0x80090303L)
#endif
#ifndef SEC_E_INTERNAL_ERROR
#define SEC_E_INTERNAL_ERROR ((HRESULT)0x80090304L)
#endif
#ifndef SEC_E_SECPKG_NOT_FOUND
#define SEC_E_SECPKG_NOT_FOUND ((HRESULT)0x80090305L)
#endif
#ifndef SEC_E_NOT_OWNER
#define SEC_E_NOT_OWNER ((HRESULT)0x80090306L)
#endif
#ifndef SEC_E_CANNOT_INSTALL
#define SEC_E_CANNOT_INSTALL ((HRESULT)0x80090307L)
#endif
#ifndef SEC_E_INVALID_TOKEN
#define SEC_E_INVALID_TOKEN ((HRESULT)0x80090308L)
#endif
#ifndef SEC_E_CANNOT_PACK
#define SEC_E_CANNOT_PACK ((HRESULT)0x80090309L)
#endif
#ifndef SEC_E_QOP_NOT_SUPPORTED
#define SEC_E_QOP_NOT_SUPPORTED ((HRESULT)0x8009030AL)
#endif
#ifndef SEC_E_NO_IMPERSONATION
#define SEC_E_NO_IMPERSONATION ((HRESULT)0x8009030BL)
#endif
#ifndef SEC_E_LOGON_DENIED
#define SEC_E_LOGON_DENIED ((HRESULT)0x8009030CL)
#endif
#ifndef SEC_E_UNKNOWN_CREDENTIALS
#define SEC_E_UNKNOWN_CREDENTIALS ((HRESULT)0x8009030DL)
#endif
#ifndef SEC_E_NO_CREDENTIALS
#define SEC_E_NO_CREDENTIALS ((HRESULT)0x8009030EL)
#endif
#ifndef SEC_E_MESSAGE_ALTERED
#define SEC_E_MESSAGE_ALTERED ((HRESULT)0x8009030FL)
#endif
#ifndef SEC_E_OUT_OF_SEQUENCE
#define SEC_E_OUT_OF_SEQUENCE ((HRESULT)0x80090310L)
#endif
#ifndef SEC_E_NO_AUTHENTICATING_AUTHORITY
#define SEC_E_NO_AUTHENTICATING_AUTHORITY ((HRESULT)0x80090311L)
#endif
#ifndef SEC_E_BAD_PKGID
#define SEC_E_BAD_PKGID ((HRESULT)0x80090316L)
#endif
#ifndef SEC_E_CONTEXT_EXPIRED
#define SEC_E_CONTEXT_EXPIRED ((HRESULT)0x80090317L)
#endif
#ifndef SEC_E_INCOMPLETE_MESSAGE
#define SEC_E_INCOMPLETE_MESSAGE ((HRESULT)0x80090318L)
#endif
#ifndef SEC_E_INCOMPLETE_CREDENTIALS
#define SEC_E_INCOMPLETE_CREDENTIALS ((HRESULT)0x80090320L)
#endif
#ifndef SEC_E_BUFFER_TOO_SMALL
#define SEC_E_BUFFER_TOO_SMALL ((HRESULT)0x80090321L)
#endif
#ifndef SEC_E_WRONG_PRINCIPAL
#define SEC_E_WRONG_PRINCIPAL ((HRESULT)0x80090322L)
#endif
#ifndef SEC_E_TIME_SKEW
#define SEC_E_TIME_SKEW ((HRESULT)0x80090324L)
#endif
#ifndef SEC_E_UNTRUSTED_ROOT
#define SEC_E_UNTRUSTED_ROOT ((HRESULT)0x80090325L)
#endif
#ifndef SEC_E_ILLEGAL_MESSAGE
#define SEC_E_ILLEGAL_MESSAGE ((HRESULT)0x80090326L)
#endif
#ifndef SEC_E_CERT_UNKNOWN
#define SEC_E_CERT_UNKNOWN ((HRESULT)0x80090327L)
#endif
#ifndef SEC_E_CERT_EXPIRED
#define SEC_E_CERT_EXPIRED ((HRESULT)0x80090328L)
#endif
#ifndef SEC_E_ENCRYPT_FAILURE
#define SEC_E_ENCRYPT_FAILURE ((HRESULT)0x80090329L)
#endif
#ifndef SEC_E_DECRYPT_FAILURE
#define SEC_E_DECRYPT_FAILURE ((HRESULT)0x80090330L)
#endif
#ifndef SEC_E_ALGORITHM_MISMATCH
#define SEC_E_ALGORITHM_MISMATCH ((HRESULT)0x80090331L)
#endif
#ifndef SEC_E_SECURITY_QOS_FAILED
#define SEC_E_SECURITY_QOS_FAILED ((HRESULT)0x80090332L)
#endif
#ifndef SEC_E_UNFINISHED_CONTEXT_DELETED
#define SEC_E_UNFINISHED_CONTEXT_DELETED ((HRESULT)0x80090333L)
#endif
#ifndef SEC_E_NO_TGT_REPLY
#define SEC_E_NO_TGT_REPLY ((HRESULT)0x80090334L)
#endif
#ifndef SEC_E_NO_IP_ADDRESSES
#define SEC_E_NO_IP_ADDRESSES ((HRESULT)0x80090335L)
#endif
#ifndef SEC_E_WRONG_CREDENTIAL_HANDLE
#define SEC_E_WRONG_CREDENTIAL_HANDLE ((HRESULT)0x80090336L)
#endif
#ifndef SEC_E_CRYPTO_SYSTEM_INVALID
#define SEC_E_CRYPTO_SYSTEM_INVALID ((HRESULT)0x80090337L)
#endif
#ifndef SEC_E_MAX_REFERRALS_EXCEEDED
#define SEC_E_MAX_REFERRALS_EXCEEDED ((HRESULT)0x80090338L)
#endif
#ifndef SEC_E_MUST_BE_KDC
#define SEC_E_MUST_BE_KDC ((HRESULT)0x80090339L)
#endif
#ifndef SEC_E_STRONG_CRYPTO_NOT_SUPPORTED
#define SEC_E_STRONG_CRYPTO_NOT_SUPPORTED ((HRESULT)0x8009033AL)
#endif
#ifndef SEC_E_TOO_MANY_PRINCIPALS
#define SEC_E_TOO_MANY_PRINCIPALS ((HRESULT)0x8009033BL)
#endif
#ifndef SEC_E_NO_PA_DATA
#define SEC_E_NO_PA_DATA ((HRESULT)0x8009033CL)
#endif
#ifndef SEC_E_PKINIT_NAME_MISMATCH
#define SEC_E_PKINIT_NAME_MISMATCH ((HRESULT)0x8009033DL)
#endif
#ifndef SEC_E_SMARTCARD_LOGON_REQUIRED
#define SEC_E_SMARTCARD_LOGON_REQUIRED ((HRESULT)0x8009033EL)
#endif
#ifndef SEC_E_SHUTDOWN_IN_PROGRESS
#define SEC_E_SHUTDOWN_IN_PROGRESS ((HRESULT)0x8009033FL)
#endif
#ifndef SEC_E_KDC_INVALID_REQUEST
#define SEC_E_KDC_INVALID_REQUEST ((HRESULT)0x80090340L)
#endif
#ifndef SEC_E_KDC_UNABLE_TO_REFER
#define SEC_E_KDC_UNABLE_TO_REFER ((HRESULT)0x80090341L)
#endif
#ifndef SEC_E_KDC_UNKNOWN_ETYPE
#define SEC_E_KDC_UNKNOWN_ETYPE ((HRESULT)0x80090342L)
#endif
#ifndef SEC_E_UNSUPPORTED_PREAUTH
#define SEC_E_UNSUPPORTED_PREAUTH ((HRESULT)0x80090343L)
#endif
#ifndef SEC_E_DELEGATION_REQUIRED
#define SEC_E_DELEGATION_REQUIRED ((HRESULT)0x80090345L)
#endif
#ifndef SEC_E_BAD_BINDINGS
#define SEC_E_BAD_BINDINGS ((HRESULT)0x80090346L)
#endif
#ifndef SEC_E_MULTIPLE_ACCOUNTS
#define SEC_E_MULTIPLE_ACCOUNTS ((HRESULT)0x80090347L)
#endif
#ifndef SEC_E_NO_KERB_KEY
#define SEC_E_NO_KERB_KEY ((HRESULT)0x80090348L)
#endif
#ifndef SEC_E_CERT_WRONG_USAGE
#define SEC_E_CERT_WRONG_USAGE ((HRESULT)0x80090349L)
#endif
#ifndef SEC_E_DOWNGRADE_DETECTED
#define SEC_E_DOWNGRADE_DETECTED ((HRESULT)0x80090350L)
#endif
#ifndef SEC_E_SMARTCARD_CERT_REVOKED
#define SEC_E_SMARTCARD_CERT_REVOKED ((HRESULT)0x80090351L)
#endif
#ifndef SEC_E_ISSUING_CA_UNTRUSTED
#define SEC_E_ISSUING_CA_UNTRUSTED ((HRESULT)0x80090352L)
#endif
#ifndef SEC_E_REVOCATION_OFFLINE_C
#define SEC_E_REVOCATION_OFFLINE_C ((HRESULT)0x80090353L)
#endif
#ifndef SEC_E_PKINIT_CLIENT_FAILURE
#define SEC_E_PKINIT_CLIENT_FAILURE ((HRESULT)0x80090354L)
#endif
#ifndef SEC_E_SMARTCARD_CERT_EXPIRED
#define SEC_E_SMARTCARD_CERT_EXPIRED ((HRESULT)0x80090355L)
#endif
#ifndef SEC_E_NO_S4U_PROT_SUPPORT
#define SEC_E_NO_S4U_PROT_SUPPORT ((HRESULT)0x80090356L)
#endif
#ifndef SEC_E_CROSSREALM_DELEGATION_FAILURE
#define SEC_E_CROSSREALM_DELEGATION_FAILURE ((HRESULT)0x80090357L)
#endif
#ifndef SEC_E_REVOCATION_OFFLINE_KDC
#define SEC_E_REVOCATION_OFFLINE_KDC ((HRESULT)0x80090358L)
#endif
#ifndef SEC_E_ISSUING_CA_UNTRUSTED_KDC
#define SEC_E_ISSUING_CA_UNTRUSTED_KDC ((HRESULT)0x80090359L)
#endif
#ifndef SEC_E_KDC_CERT_EXPIRED
#define SEC_E_KDC_CERT_EXPIRED ((HRESULT)0x8009035AL)
#endif
#ifndef SEC_E_KDC_CERT_REVOKED
#define SEC_E_KDC_CERT_REVOKED ((HRESULT)0x8009035BL)
#endif
#endif /* __MINGW32CE__ */
/* Offered by mingw-w64 v8+. MS SDK 6.0A+. */
#ifndef SEC_E_INVALID_PARAMETER
#define SEC_E_INVALID_PARAMETER ((HRESULT)0x8009035DL)
@ -302,44 +83,11 @@ extern PSecurityFunctionTable Curl_pSecFn;
#define SEC_E_POLICY_NLTM_ONLY ((HRESULT)0x8009035FL)
#endif
#ifdef __MINGW32CE__
#ifndef SEC_I_CONTINUE_NEEDED
#define SEC_I_CONTINUE_NEEDED ((HRESULT)0x00090312L)
#endif
#ifndef SEC_I_COMPLETE_NEEDED
#define SEC_I_COMPLETE_NEEDED ((HRESULT)0x00090313L)
#endif
#ifndef SEC_I_COMPLETE_AND_CONTINUE
#define SEC_I_COMPLETE_AND_CONTINUE ((HRESULT)0x00090314L)
#endif
#ifndef SEC_I_LOCAL_LOGON
#define SEC_I_LOCAL_LOGON ((HRESULT)0x00090315L)
#endif
#ifndef SEC_I_CONTEXT_EXPIRED
#define SEC_I_CONTEXT_EXPIRED ((HRESULT)0x00090317L)
#endif
#ifndef SEC_I_INCOMPLETE_CREDENTIALS
#define SEC_I_INCOMPLETE_CREDENTIALS ((HRESULT)0x00090320L)
#endif
#ifndef SEC_I_RENEGOTIATE
#define SEC_I_RENEGOTIATE ((HRESULT)0x00090321L)
#endif
#ifndef SEC_I_NO_LSA_CONTEXT
#define SEC_I_NO_LSA_CONTEXT ((HRESULT)0x00090323L)
#endif
#endif /* __MINGW32CE__ */
/* Offered by mingw-w64 v8+. MS SDK 6.0A+. */
#ifndef SEC_I_SIGNATURE_NEEDED
#define SEC_I_SIGNATURE_NEEDED ((HRESULT)0x0009035CL)
#endif
#ifdef __MINGW32CE__
#ifndef CRYPT_E_NOT_IN_REVOCATION_DATABASE
#define CRYPT_E_NOT_IN_REVOCATION_DATABASE ((HRESULT)0x80092014L)
#endif
#endif /* __MINGW32CE__ */
/*
* Definitions required from ntsecapi.h are directly provided below this point
* to avoid including ntsecapi.h due to a conflict with OpenSSL's safestack.h

View file

@ -69,7 +69,7 @@ curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T
rc = pthread_create(t, NULL, curl_thread_create_thunk, ac);
if(rc) {
CURL_SETERRNO(rc);
errno = rc;
goto err;
}
@ -109,10 +109,9 @@ curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T
if(!t) {
DWORD gle = GetLastError();
/* !checksrc! disable ERRNOVAR 1 */
int err = (gle == ERROR_ACCESS_DENIED ||
gle == ERROR_NOT_ENOUGH_MEMORY) ?
EACCES : EINVAL;
CURL_SETERRNO(err);
errno = (gle == ERROR_ACCESS_DENIED ||
gle == ERROR_NOT_ENOUGH_MEMORY) ?
EACCES : EINVAL;
return curl_thread_t_null;
}
return t;
@ -128,11 +127,7 @@ void Curl_thread_destroy(curl_thread_t *hnd)
int Curl_thread_join(curl_thread_t *hnd)
{
#ifdef UNDER_CE
int ret = (WaitForSingleObject(*hnd, INFINITE) == WAIT_OBJECT_0);
#else
int ret = (WaitForSingleObjectEx(*hnd, INFINITE, FALSE) == WAIT_OBJECT_0);
#endif
Curl_thread_destroy(hnd);

View file

@ -47,7 +47,7 @@ int curlx_fseek(void *stream, curl_off_t offset, int whence)
#endif
}
#if defined(_WIN32) && !defined(UNDER_CE)
#ifdef _WIN32
#include "multibyte.h"
@ -142,7 +142,7 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out)
else if(!wcsncmp(fbuf, L"\\\\.\\", 4))
fbuf[2] = '?';
else if(!wcsncmp(fbuf, L"\\\\.", 3) || !wcsncmp(fbuf, L"\\\\?", 3)) {
/* Unexpected, not UNC. The formatting doc doesn't allow this AFAICT. */
/* Unexpected, not UNC. The formatting doc does not allow this AFAICT. */
goto cleanup;
}
else {
@ -235,7 +235,7 @@ int curlx_win32_open(const char *filename, int oflag, ...)
}
else
/* !checksrc! disable ERRNOVAR 1 */
CURL_SETERRNO(EINVAL);
errno = EINVAL;
#else
if(fix_excessive_path(filename, &fixed))
target = fixed;
@ -266,7 +266,7 @@ FILE *curlx_win32_fopen(const char *filename, const char *mode)
}
else
/* !checksrc! disable ERRNOVAR 1 */
CURL_SETERRNO(EINVAL);
errno = EINVAL;
curlx_unicodefree(filename_w);
curlx_unicodefree(mode_w);
#else
@ -304,7 +304,7 @@ int curlx_win32_stat(const char *path, struct_stat *buffer)
}
else
/* !checksrc! disable ERRNOVAR 1 */
CURL_SETERRNO(EINVAL);
errno = EINVAL;
#else
if(fix_excessive_path(path, &fixed))
target = fixed;
@ -321,4 +321,4 @@ int curlx_win32_stat(const char *path, struct_stat *buffer)
return result;
}
#endif /* _WIN32 && !UNDER_CE */
#endif /* _WIN32 */

View file

@ -34,7 +34,7 @@
int curlx_fseek(void *stream, curl_off_t offset, int whence);
#if defined(_WIN32) && !defined(UNDER_CE)
#ifdef _WIN32
FILE *curlx_win32_fopen(const char *filename, const char *mode);
int curlx_win32_stat(const char *path, struct_stat *buffer);
int curlx_win32_open(const char *filename, int oflag, ...);

View file

@ -72,9 +72,9 @@ static char *inet_ntop4(const unsigned char *src, char *dst, size_t size)
len = strlen(tmp);
if(len == 0 || len >= size) {
#ifdef USE_WINSOCK
CURL_SETERRNO(WSAEINVAL);
errno = WSAEINVAL;
#else
CURL_SETERRNO(ENOSPC);
errno = ENOSPC;
#endif
return NULL;
}
@ -160,7 +160,7 @@ static char *inet_ntop6(const unsigned char *src, char *dst, size_t size)
break;
}
else {
/* Lower-case digits. Can't use the set from mprintf.c since this
/* Lower-case digits. Cannot use the set from mprintf.c since this
needs to work as a curlx function */
static const unsigned char ldigits[] = "0123456789abcdef";
@ -186,9 +186,9 @@ static char *inet_ntop6(const unsigned char *src, char *dst, size_t size)
*/
if((size_t)(tp - tmp) > size) {
#ifdef USE_WINSOCK
CURL_SETERRNO(WSAEINVAL);
errno = WSAEINVAL;
#else
CURL_SETERRNO(ENOSPC);
errno = ENOSPC;
#endif
return NULL;
}
@ -215,7 +215,7 @@ char *curlx_inet_ntop(int af, const void *src, char *buf, size_t size)
case AF_INET6:
return inet_ntop6((const unsigned char *)src, buf, size);
default:
CURL_SETERRNO(SOCKEAFNOSUPPORT);
errno = SOCKEAFNOSUPPORT;
return NULL;
}
}

View file

@ -82,7 +82,7 @@ curlx_inet_pton(int af, const char *src, void *dst)
case AF_INET6:
return inet_pton6(src, (unsigned char *)dst);
default:
CURL_SETERRNO(SOCKEAFNOSUPPORT);
errno = SOCKEAFNOSUPPORT;
return -1;
}
/* NOTREACHED */

View file

@ -287,13 +287,10 @@ const char *curlx_strerror(int err, char *buf, size_t buflen)
*buf = '\0';
#ifdef _WIN32
#ifndef UNDER_CE
/* 'sys_nerr' is the maximum errno number, it is not widely portable */
if(err >= 0 && err < sys_nerr)
SNPRINTF(buf, buflen, "%s", sys_errlist[err]);
else
#endif
{
else {
if(
#ifdef USE_WINSOCK
!get_winsock_error(err, buf, buflen) &&
@ -350,7 +347,7 @@ const char *curlx_strerror(int err, char *buf, size_t buflen)
*p = '\0';
if(errno != old_errno)
CURL_SETERRNO(old_errno);
errno = old_errno;
#ifdef _WIN32
if(old_win_err != GetLastError())

View file

@ -111,12 +111,6 @@ bool curlx_verify_windows_version(const unsigned int majorVersion,
/* we are always running on PLATFORM_WINNT */
matched = FALSE;
}
#elif defined(UNDER_CE)
(void)majorVersion;
(void)minorVersion;
(void)buildVersion;
(void)platform;
(void)condition;
#else
ULONGLONG cm = 0;
struct OUR_OSVERSIONINFOEXW osver;
@ -139,7 +133,7 @@ bool curlx_verify_windows_version(const unsigned int majorVersion,
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
#endif
pRtlVerifyVersionInfo = CURLX_FUNCTION_CAST(RTLVERIFYVERSIONINFO_FN,
GetProcAddress(GetModuleHandleA("ntdll"), "RtlVerifyVersionInfo"));
GetProcAddress(GetModuleHandle(TEXT("ntdll")), "RtlVerifyVersionInfo"));
#if defined(__clang__) && __clang_major__ >= 16
#pragma clang diagnostic pop
#endif

View file

@ -61,8 +61,7 @@ const char *curlx_get_winapi_error(DWORD err, char *buf, size_t buflen)
/* We return the local codepage version of the error string because if it is
output to the user's terminal it will likely be with functions which
expect the local codepage (eg fprintf, failf, infof).
FormatMessageW -> wcstombs is used for Windows CE compatibility. */
expect the local codepage (eg fprintf, failf, infof). */
if(FormatMessageW((FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS), NULL, err,
LANG_NEUTRAL, wbuf, CURL_ARRAYSIZE(wbuf), NULL)) {
@ -118,7 +117,7 @@ const char *curlx_winapi_strerror(DWORD err, char *buf, size_t buflen)
#endif
if(errno != old_errno)
CURL_SETERRNO(old_errno);
errno = old_errno;
if(old_win_err != GetLastError())
SetLastError(old_win_err);

View file

@ -37,7 +37,7 @@
#if defined(USE_OPENSSL) && \
!defined(OPENSSL_IS_BORINGSSL) && !defined(OPENSSL_IS_AWSLC) && \
!defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
!defined(LIBRESSL_VERSION_NUMBER)
#define PREVENT_OPENSSL_MEMLEAK
#endif

View file

@ -106,12 +106,10 @@ static curl_simple_lock s_lock = CURL_SIMPLE_LOCK_INIT;
* ways, but at this point it must be defined as the system-supplied strdup
* so the callback pointer is initialized correctly.
*/
#ifdef UNDER_CE
#define system_strdup _strdup
#elif !defined(HAVE_STRDUP)
#define system_strdup Curl_strdup
#else
#ifdef HAVE_STRDUP
#define system_strdup strdup
#else
#define system_strdup Curl_strdup
#endif
#if defined(_MSC_VER) && defined(_DLL)

View file

@ -180,7 +180,7 @@ int r_getaddrinfo(const char *node,
curl_mfprintf(stderr, "ares_set_servers_ports_csv failed: %d", rc);
/* Cleanup */
ares_destroy(channel);
return EAI_MEMORY; /* we can't run */
return EAI_MEMORY; /* we cannot run */
}
}
}

View file

@ -275,7 +275,7 @@ static CURLcode file_connect(struct Curl_easy *data, bool *done)
file->fd = fd;
if(!data->state.upload && (fd == -1)) {
failf(data, "Couldn't open file %s", data->state.up.path);
failf(data, "Could not open file %s", data->state.up.path);
file_done(data, CURLE_FILE_COULDNT_READ_FILE, FALSE);
return CURLE_FILE_COULDNT_READ_FILE;
}
@ -572,7 +572,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done)
if(data->state.resume_from) {
if(!S_ISDIR(statbuf.st_mode)) {
#if defined(__AMIGA__) || defined(__MINGW32CE__)
#ifdef __AMIGA__
if(data->state.resume_from !=
lseek(fd, (off_t)data->state.resume_from, SEEK_SET))
#else

View file

@ -1867,7 +1867,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data,
}
if(!*str) {
failf(data, "Couldn't interpret the 227-response");
failf(data, "Could not interpret the 227-response");
return CURLE_FTP_WEIRD_227_FORMAT;
}
@ -2202,7 +2202,7 @@ static CURLcode ftp_state_type_resp(struct Curl_easy *data,
/* "sasserftpd" and "(u)r(x)bot ftpd" both responds with 226 after a
successful 'TYPE I'. While that is not as RFC959 says, it is still a
positive response code and we allow that. */
failf(data, "Couldn't set desired mode");
failf(data, "Could not set desired mode");
return CURLE_FTP_COULDNT_SET_TYPE;
}
if(ftpcode != 200)
@ -2392,7 +2392,7 @@ static CURLcode ftp_state_rest_resp(struct Curl_easy *data,
case FTP_RETR_REST:
if(ftpcode != 350) {
failf(data, "Couldn't use REST");
failf(data, "Could not use REST");
result = CURLE_FTP_COULDNT_USE_REST;
}
else {
@ -2537,7 +2537,7 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data,
}
else {
if((instate == FTP_LIST) && (ftpcode == 450)) {
/* simply no matching files in the dir listing */
/* simply no matching files in the directory listing */
ftp->transfer = PPTRANSFER_NONE; /* do not download anything */
ftp_state(data, ftpc, FTP_STOP); /* this phase is over */
}
@ -3052,7 +3052,7 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data,
case FTP_MKD:
if((ftpcode/100 != 2) && !ftpc->count3--) {
/* failure to MKD the dir */
/* failure to MKD the directory */
failf(data, "Failed to MKD dir: %03d", ftpcode);
result = CURLE_REMOTE_ACCESS_DENIED;
}
@ -3306,15 +3306,11 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
}
}
if(ftpc->prevpath)
infof(data, "Remembering we are in dir \"%s\"", ftpc->prevpath);
infof(data, "Remembering we are in directory \"%s\"", ftpc->prevpath);
}
/* shut down the socket to inform the server we are done */
#ifdef UNDER_CE
shutdown(conn->sock[SECONDARYSOCKET], 2); /* SD_BOTH */
#endif
if(Curl_conn_is_setup(conn, SECONDARYSOCKET)) {
if(!result && ftpc->dont_check && data->req.maxdownload > 0) {
/* partial download completed */
@ -4192,7 +4188,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data,
ftpc->dirs[0].start = 0;
ftpc->dirs[0].len = (int)dirlen;
ftpc->dirdepth = 1; /* we consider it to be a single dir */
ftpc->dirdepth = 1; /* we consider it to be a single directory */
fileName = slashPos + 1; /* rest is filename */
}
else
@ -4208,7 +4204,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data,
size_t dirAlloc = numof_slashes(rawPath);
if(dirAlloc >= FTP_MAX_DIR_DEPTH)
/* suspiciously deep dir hierarchy */
/* suspiciously deep directory hierarchy */
return CURLE_URL_MALFORMAT;
if(dirAlloc) {

View file

@ -61,11 +61,11 @@ enum {
FTP_STOR_PREQUOTE,
FTP_LIST_PREQUOTE,
FTP_POSTQUOTE,
FTP_CWD, /* change dir */
FTP_MKD, /* if the dir did not exist */
FTP_CWD, /* change directory */
FTP_MKD, /* if the directory did not exist */
FTP_MDTM, /* to figure out the datestamp */
FTP_TYPE, /* to set type when doing a head-like request */
FTP_LIST_TYPE, /* set type when about to do a dir list */
FTP_LIST_TYPE, /* set type when about to do a directory list */
FTP_RETR_LIST_TYPE,
FTP_RETR_TYPE, /* set type when about to RETR a file */
FTP_STOR_TYPE, /* set type when about to STOR a file */

View file

@ -31,7 +31,7 @@
static char *GetEnv(const char *variable)
{
#if defined(CURL_WINDOWS_UWP) || defined(UNDER_CE) || \
#if defined(CURL_WINDOWS_UWP) || \
defined(__ORBIS__) || defined(__PROSPERO__) /* PlayStation 4 and 5 */
(void)variable;
return NULL;

View file

@ -204,31 +204,31 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info,
} lptr;
#ifdef DEBUGBUILD
const char *timestr = getenv("CURL_TIME");
if(timestr) {
curl_off_t val;
curlx_str_number(&timestr, &val, TIME_T_MAX);
switch(info) {
case CURLINFO_LOCAL_PORT:
*param_longp = (long)val;
return CURLE_OK;
default:
break;
}
}
const char *envstr;
/* use another variable for this to allow different values */
timestr = getenv("CURL_DEBUG_SIZE");
if(timestr) {
curl_off_t val;
curlx_str_number(&timestr, &val, LONG_MAX);
switch(info) {
case CURLINFO_HEADER_SIZE:
case CURLINFO_REQUEST_SIZE:
switch(info) {
case CURLINFO_LOCAL_PORT:
envstr = getenv("CURL_TIME");
if(envstr) {
curl_off_t val;
curlx_str_number(&envstr, &val, TIME_T_MAX);
*param_longp = (long)val;
return CURLE_OK;
default:
break;
}
break;
case CURLINFO_HEADER_SIZE:
case CURLINFO_REQUEST_SIZE:
envstr = getenv("CURL_DEBUG_SIZE");
if(envstr) {
curl_off_t val;
curlx_str_number(&envstr, &val, LONG_MAX);
*param_longp = (long)val;
return CURLE_OK;
}
break;
default:
break;
}
#endif
@ -381,28 +381,29 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info,
curl_off_t *param_offt)
{
#ifdef DEBUGBUILD
const char *timestr = getenv("CURL_TIME");
if(timestr) {
curl_off_t val;
curlx_str_number(&timestr, &val, CURL_OFF_T_MAX);
switch(info) {
case CURLINFO_TOTAL_TIME_T:
case CURLINFO_NAMELOOKUP_TIME_T:
case CURLINFO_CONNECT_TIME_T:
case CURLINFO_APPCONNECT_TIME_T:
case CURLINFO_PRETRANSFER_TIME_T:
case CURLINFO_POSTTRANSFER_TIME_T:
case CURLINFO_QUEUE_TIME_T:
case CURLINFO_STARTTRANSFER_TIME_T:
case CURLINFO_REDIRECT_TIME_T:
case CURLINFO_SPEED_DOWNLOAD_T:
case CURLINFO_SPEED_UPLOAD_T:
const char *envstr;
switch(info) {
case CURLINFO_TOTAL_TIME_T:
case CURLINFO_NAMELOOKUP_TIME_T:
case CURLINFO_CONNECT_TIME_T:
case CURLINFO_APPCONNECT_TIME_T:
case CURLINFO_PRETRANSFER_TIME_T:
case CURLINFO_POSTTRANSFER_TIME_T:
case CURLINFO_QUEUE_TIME_T:
case CURLINFO_STARTTRANSFER_TIME_T:
case CURLINFO_REDIRECT_TIME_T:
case CURLINFO_SPEED_DOWNLOAD_T:
case CURLINFO_SPEED_UPLOAD_T:
envstr = getenv("CURL_TIME");
if(envstr) {
curl_off_t val;
curlx_str_number(&envstr, &val, CURL_OFF_T_MAX);
*param_offt = (curl_off_t)val;
return CURLE_OK;
default:
break;
}
break;
default:
break;
}
#endif
switch(info) {
@ -480,26 +481,28 @@ static CURLcode getinfo_double(struct Curl_easy *data, CURLINFO info,
double *param_doublep)
{
#ifdef DEBUGBUILD
const char *timestr = getenv("CURL_TIME");
if(timestr) {
curl_off_t val;
curlx_str_number(&timestr, &val, CURL_OFF_T_MAX);
const char *envstr;
switch(info) {
case CURLINFO_TOTAL_TIME:
case CURLINFO_NAMELOOKUP_TIME:
case CURLINFO_CONNECT_TIME:
case CURLINFO_APPCONNECT_TIME:
case CURLINFO_PRETRANSFER_TIME:
case CURLINFO_STARTTRANSFER_TIME:
case CURLINFO_REDIRECT_TIME:
case CURLINFO_SPEED_DOWNLOAD:
case CURLINFO_SPEED_UPLOAD:
switch(info) {
case CURLINFO_TOTAL_TIME:
case CURLINFO_NAMELOOKUP_TIME:
case CURLINFO_CONNECT_TIME:
case CURLINFO_APPCONNECT_TIME:
case CURLINFO_PRETRANSFER_TIME:
case CURLINFO_STARTTRANSFER_TIME:
case CURLINFO_REDIRECT_TIME:
case CURLINFO_SPEED_DOWNLOAD:
case CURLINFO_SPEED_UPLOAD:
envstr = getenv("CURL_TIME");
if(envstr) {
curl_off_t val;
curlx_str_number(&envstr, &val, CURL_OFF_T_MAX);
*param_doublep = (double)val;
return CURLE_OK;
default:
break;
}
break;
default:
break;
}
#endif
switch(info) {

View file

@ -51,7 +51,7 @@ static void copy_header_external(struct Curl_header_store *hs,
h->index = index;
/* this will randomly OR a reserved bit for the sole purpose of making it
impossible for applications to do == comparisons, as that would otherwise
be very tempting and then lead to the reserved bits not being reserved
be tempting and then lead to the reserved bits not being reserved
anymore. */
h->origin = (unsigned int)(hs->type | (1 << 27));
h->anchor = e;

View file

@ -42,9 +42,7 @@
#endif
#include <setjmp.h>
#ifndef UNDER_CE
#include <signal.h>
#endif
#include "urldata.h"
#include "sendf.h"
@ -956,7 +954,7 @@ out:
/* we got a response, create a dns entry, add to cache, return */
dns = Curl_dnscache_mk_entry(data, addr, hostname, 0, port, FALSE);
if(!dns || Curl_dnscache_add(data, dns)) {
/* this is OOM or similar, don't store such negative resolves */
/* this is OOM or similar, do not store such negative resolves */
keep_negative = FALSE;
goto error;
}
@ -1393,7 +1391,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data)
error = FALSE;
err:
if(error) {
failf(data, "Couldn't parse CURLOPT_RESOLVE entry '%s'",
failf(data, "Could not parse CURLOPT_RESOLVE entry '%s'",
hostp->data);
Curl_freeaddrinfo(head);
return CURLE_SETOPT_OPTION_SYNTAX;

View file

@ -277,7 +277,7 @@ struct stsentry *Curl_hsts(struct hsts *h, const char *hostname,
blen = ntail;
}
}
/* avoid curl_strequal because the host name is not null-terminated */
/* avoid curl_strequal because the hostname is not null-terminated */
if((hlen == ntail) && curl_strnequal(hostname, sts->host, hlen))
return sts;
}

View file

@ -504,7 +504,7 @@ static CURLcode http_perhapsrewind(struct Curl_easy *data,
return CURLE_OK;
if(abort_upload) {
/* We'd like to abort the upload - but should we? */
/* We would like to abort the upload - but should we? */
#ifdef USE_NTLM
if((data->state.authproxy.picked == CURLAUTH_NTLM) ||
(data->state.authhost.picked == CURLAUTH_NTLM)) {
@ -1716,7 +1716,7 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data,
curlx_str_untilnl(&p, &val, MAX_HTTP_RESP_HEADER_SIZE);
curlx_str_trimblanks(&val);
if(!curlx_strlen(&val))
/* no content, don't send this */
/* no content, do not send this */
continue;
}
else
@ -2404,7 +2404,7 @@ static CURLcode http_add_content_hds(struct Curl_easy *data,
(data->req.authneg ||
!Curl_checkheaders(data, STRCONST("Content-Length")))) {
/* we allow replacing this header if not during auth negotiation,
although it is not very wise to actually set your own */
although it is not wise to actually set your own */
result = curlx_dyn_addf(r, "Content-Length: %" FMT_OFF_T "\r\n",
req_clen);
}
@ -4018,7 +4018,7 @@ static CURLcode http_on_response(struct Curl_easy *data,
*
* The check for close above is done simply because of something
* else has already deemed the connection to get closed then
* something else should've considered the big picture and we
* something else should have considered the big picture and we
* avoid this check.
*
*/
@ -4187,7 +4187,7 @@ static CURLcode http_rw_hd(struct Curl_easy *data,
k->httpcode = (p[0] - '0') * 100 + (p[1] - '0') * 10 +
(p[2] - '0');
/* RFC 9112 requires a single space following the status code,
but the browsers don't so let's not insist */
but the browsers do not so let's not insist */
fine_statusline = TRUE;
}
}
@ -4558,12 +4558,12 @@ out:
static CURLcode req_assign_url_authority(struct httpreq *req, CURLU *url)
{
char *user, *pass, *host, *port;
char *host, *port;
struct dynbuf buf;
CURLUcode uc;
CURLcode result = CURLE_URL_MALFORMAT;
user = pass = host = port = NULL;
host = port = NULL;
curlx_dyn_init(&buf, DYN_HTTP_REQUEST);
uc = curl_url_get(url, CURLUPART_HOST, &host, 0);
@ -4578,28 +4578,7 @@ static CURLcode req_assign_url_authority(struct httpreq *req, CURLU *url)
uc = curl_url_get(url, CURLUPART_PORT, &port, CURLU_NO_DEFAULT_PORT);
if(uc && uc != CURLUE_NO_PORT)
goto out;
uc = curl_url_get(url, CURLUPART_USER, &user, 0);
if(uc && uc != CURLUE_NO_USER)
goto out;
if(user) {
uc = curl_url_get(url, CURLUPART_PASSWORD, &pass, 0);
if(uc && uc != CURLUE_NO_PASSWORD)
goto out;
}
if(user) {
result = curlx_dyn_add(&buf, user);
if(result)
goto out;
if(pass) {
result = curlx_dyn_addf(&buf, ":%s", pass);
if(result)
goto out;
}
result = curlx_dyn_add(&buf, "@");
if(result)
goto out;
}
result = curlx_dyn_add(&buf, host);
if(result)
goto out;
@ -4614,8 +4593,6 @@ static CURLcode req_assign_url_authority(struct httpreq *req, CURLU *url)
result = CURLE_OK;
out:
free(user);
free(pass);
free(host);
free(port);
curlx_dyn_free(&buf);

Some files were not shown because too many files have changed in this diff Show more