Compare commits
14 Commits
renovate/a
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4834a7d6d | ||
|
|
5693342ec2 | ||
|
|
c693cc02b0 | ||
|
|
e7751571eb | ||
|
|
7211576442 | ||
|
|
794dfe7fc4 | ||
|
|
049352dd80 | ||
|
|
08c7c937dc | ||
|
|
2e585f5640 | ||
|
|
399cb7130a | ||
|
|
5a021aba41 | ||
|
|
6913c9b6ab | ||
|
|
953cd694dc | ||
|
|
af6172c8f2 |
33
.github/workflows/http3-linux.yml
vendored
33
.github/workflows/http3-linux.yml
vendored
@ -61,7 +61,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: 'cache quictls'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-quictls-no-deprecated
|
||||
env:
|
||||
cache-name: cache-quictls-no-deprecated
|
||||
@ -70,7 +70,7 @@ jobs:
|
||||
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.quictls-version }}-quic1
|
||||
|
||||
- name: 'cache gnutls'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-gnutls
|
||||
env:
|
||||
cache-name: cache-gnutls
|
||||
@ -79,7 +79,7 @@ jobs:
|
||||
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.gnutls-version }}
|
||||
|
||||
- name: 'cache wolfssl'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-wolfssl
|
||||
env:
|
||||
cache-name: cache-wolfssl
|
||||
@ -88,7 +88,7 @@ jobs:
|
||||
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.wolfssl-version }}
|
||||
|
||||
- name: 'cache nghttp3'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-nghttp3
|
||||
env:
|
||||
cache-name: cache-nghttp3
|
||||
@ -97,7 +97,7 @@ jobs:
|
||||
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp3-version }}
|
||||
|
||||
- name: 'cache ngtcp2'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-ngtcp2
|
||||
env:
|
||||
cache-name: cache-ngtcp2
|
||||
@ -106,7 +106,7 @@ jobs:
|
||||
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.ngtcp2-version }}-${{ env.quictls-version }}-${{ env.gnutls-version }}-${{ env.wolfssl-version }}
|
||||
|
||||
- name: 'cache nghttp2'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-nghttp2
|
||||
env:
|
||||
cache-name: cache-nghttp2
|
||||
@ -309,7 +309,7 @@ jobs:
|
||||
echo 'CXX=g++-12' >> $GITHUB_ENV
|
||||
|
||||
- name: 'cache quictls'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-quictls-no-deprecated
|
||||
env:
|
||||
cache-name: cache-quictls-no-deprecated
|
||||
@ -320,7 +320,7 @@ jobs:
|
||||
|
||||
- name: 'cache gnutls'
|
||||
if: matrix.build.name == 'gnutls'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-gnutls
|
||||
env:
|
||||
cache-name: cache-gnutls
|
||||
@ -331,7 +331,7 @@ jobs:
|
||||
|
||||
- name: 'cache wolfssl'
|
||||
if: matrix.build.name == 'wolfssl'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-wolfssl
|
||||
env:
|
||||
cache-name: cache-wolfssl
|
||||
@ -341,7 +341,7 @@ jobs:
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- name: 'cache nghttp3'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-nghttp3
|
||||
env:
|
||||
cache-name: cache-nghttp3
|
||||
@ -351,7 +351,7 @@ jobs:
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- name: 'cache ngtcp2'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-ngtcp2
|
||||
env:
|
||||
cache-name: cache-ngtcp2
|
||||
@ -361,7 +361,7 @@ jobs:
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- name: 'cache nghttp2'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-nghttp2
|
||||
env:
|
||||
cache-name: cache-nghttp2
|
||||
@ -372,7 +372,7 @@ jobs:
|
||||
|
||||
- name: 'cache openssl'
|
||||
if: matrix.build.name == 'openssl-quic'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-openssl
|
||||
env:
|
||||
cache-name: cache-openssl
|
||||
@ -392,7 +392,7 @@ jobs:
|
||||
|
||||
- name: 'cache quiche'
|
||||
if: matrix.build.name == 'quiche'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-quiche
|
||||
env:
|
||||
cache-name: cache-quiche
|
||||
@ -454,9 +454,7 @@ jobs:
|
||||
grep -F '#define' bld/lib/curl_config.h | sort || true
|
||||
|
||||
- name: 'test configs'
|
||||
run: |
|
||||
cat bld/tests/config || true
|
||||
cat bld/tests/http/config.ini || true
|
||||
run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true
|
||||
|
||||
- name: 'build'
|
||||
run: |
|
||||
@ -500,7 +498,6 @@ jobs:
|
||||
|
||||
- name: 'run pytest event based'
|
||||
env:
|
||||
TFLAGS: '${{ matrix.build.tflags }}'
|
||||
CURL_TEST_EVENT: 1
|
||||
CURL_CI: github
|
||||
PYTEST_ADDOPTS: '--color=yes'
|
||||
|
||||
35
.github/workflows/linux.yml
vendored
35
.github/workflows/linux.yml
vendored
@ -304,7 +304,8 @@ jobs:
|
||||
libtool autoconf automake pkgconf ninja-build \
|
||||
${{ matrix.build.install_steps != 'skipall' && matrix.build.install_steps != 'skiprun' && 'stunnel4' || '' }} \
|
||||
libpsl-dev libbrotli-dev libzstd-dev \
|
||||
${{ matrix.build.install_packages }}
|
||||
${{ matrix.build.install_packages }} \
|
||||
${{ contains(matrix.build.install_steps, 'pytest') && 'apache2 apache2-dev libnghttp2-dev vsftpd' || '' }}
|
||||
python3 -m venv $HOME/venv
|
||||
|
||||
- name: 'install prereqs'
|
||||
@ -319,11 +320,6 @@ jobs:
|
||||
${{ matrix.build.install_packages }}
|
||||
python3 -m venv $HOME/venv
|
||||
|
||||
- name: 'install prereqs for pytest'
|
||||
if: contains(matrix.build.install_steps, 'pytest')
|
||||
run: |
|
||||
sudo apt-get -o Dpkg::Use-Pty=0 install apache2 apache2-dev libnghttp2-dev vsftpd
|
||||
|
||||
- name: 'install dependencies'
|
||||
if: startsWith(matrix.build.container, 'alpine')
|
||||
run: |
|
||||
@ -335,7 +331,7 @@ jobs:
|
||||
|
||||
- name: 'cache bearssl'
|
||||
if: contains(matrix.build.install_steps, 'bearssl')
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-bearssl
|
||||
env:
|
||||
cache-name: cache-bearssl
|
||||
@ -357,7 +353,7 @@ jobs:
|
||||
|
||||
- name: 'cache libressl'
|
||||
if: contains(matrix.build.install_steps, 'libressl')
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-libressl
|
||||
env:
|
||||
cache-name: cache-libressl
|
||||
@ -377,7 +373,7 @@ jobs:
|
||||
|
||||
- name: 'cache wolfssl (all)'
|
||||
if: contains(matrix.build.install_steps, 'wolfssl-all')
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-wolfssl-all
|
||||
env:
|
||||
cache-name: cache-wolfssl-all
|
||||
@ -399,7 +395,7 @@ jobs:
|
||||
|
||||
- name: 'cache wolfssl (opensslextra)'
|
||||
if: contains(matrix.build.install_steps, 'wolfssl-opensslextra')
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-wolfssl-opensslextra
|
||||
env:
|
||||
cache-name: cache-wolfssl-opensslextra
|
||||
@ -421,7 +417,7 @@ jobs:
|
||||
|
||||
- name: 'cache wolfssh'
|
||||
if: contains(matrix.build.install_steps, 'wolfssl')
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-wolfssh
|
||||
env:
|
||||
cache-name: cache-wolfssh
|
||||
@ -443,7 +439,7 @@ jobs:
|
||||
|
||||
- name: 'cache mbedtls'
|
||||
if: contains(matrix.build.install_steps, 'mbedtls')
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-mbedtls
|
||||
env:
|
||||
cache-name: cache-mbedtls-threadsafe
|
||||
@ -467,7 +463,7 @@ jobs:
|
||||
|
||||
- name: 'cache openssl (thread sanitizer)'
|
||||
if: contains(matrix.build.install_steps, 'openssl-tsan')
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-openssl-tsan
|
||||
env:
|
||||
cache-name: cache-openssl-tsan
|
||||
@ -486,7 +482,7 @@ jobs:
|
||||
|
||||
- name: 'cache quictls'
|
||||
if: contains(matrix.build.install_steps, 'quictls')
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-quictls
|
||||
env:
|
||||
cache-name: cache-quictls
|
||||
@ -505,7 +501,7 @@ jobs:
|
||||
|
||||
- name: 'cache msh3'
|
||||
if: contains(matrix.build.install_steps, 'msh3')
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-msh3
|
||||
env:
|
||||
cache-name: cache-msh3
|
||||
@ -524,7 +520,7 @@ jobs:
|
||||
|
||||
- name: 'cache awslc'
|
||||
if: contains(matrix.build.install_steps, 'awslc')
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-awslc
|
||||
env:
|
||||
cache-name: cache-awslc
|
||||
@ -546,7 +542,7 @@ jobs:
|
||||
|
||||
- name: 'cache rustls'
|
||||
if: contains(matrix.build.install_steps, 'rustls')
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-rustls
|
||||
env:
|
||||
cache-name: cache-rustls
|
||||
@ -616,9 +612,7 @@ jobs:
|
||||
grep -F '#define' bld/lib/curl_config.h | sort || true
|
||||
|
||||
- name: 'test configs'
|
||||
run: |
|
||||
cat bld/tests/config || true
|
||||
cat bld/tests/http/config.ini || true
|
||||
run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true
|
||||
|
||||
- name: 'build'
|
||||
run: |
|
||||
@ -694,7 +688,6 @@ jobs:
|
||||
- name: 'run pytest'
|
||||
if: contains(matrix.build.install_steps, 'pytest')
|
||||
env:
|
||||
TFLAGS: '${{ matrix.build.tflags }}'
|
||||
CURL_CI: github
|
||||
PYTEST_ADDOPTS: '--color=yes'
|
||||
run: |
|
||||
|
||||
16
.github/workflows/macos.yml
vendored
16
.github/workflows/macos.yml
vendored
@ -123,9 +123,10 @@ jobs:
|
||||
compiler: clang
|
||||
configure: --enable-debug --with-openssl=$(brew --prefix openssl)
|
||||
tflags: --test-event
|
||||
- name: 'OpenSSL libssh2 !ldap 10.15'
|
||||
- name: 'quictls libssh2 !ldap 10.15'
|
||||
compiler: clang
|
||||
configure: --enable-debug --disable-ldap --with-openssl=$(brew --prefix openssl)
|
||||
install: quictls
|
||||
configure: --enable-debug --disable-ldap --with-openssl=$(brew --prefix quictls) LDFLAGS="${LDFLAGS} -L$(brew --prefix quictls)/lib"
|
||||
macos-version-min: '10.15'
|
||||
# cmake
|
||||
- name: 'OpenSSL gsasl rtmp AppleIDN'
|
||||
@ -136,9 +137,9 @@ jobs:
|
||||
generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DUSE_APPLE_IDN=ON -DCURL_CLANG_TIDY=ON -DCLANG_TIDY=$(brew --prefix llvm)/bin/clang-tidy
|
||||
clang-tidy: true
|
||||
chkprefill: _chkprefill
|
||||
- name: 'OpenSSL +static libssh +examples'
|
||||
install: libssh
|
||||
generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DBUILD_STATIC_LIBS=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON
|
||||
- name: 'quictls +static libssh +examples'
|
||||
install: quictls libssh
|
||||
generate: -DOPENSSL_ROOT_DIR=$(brew --prefix quictls) -DBUILD_STATIC_LIBS=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON
|
||||
- name: 'SecureTransport debug'
|
||||
generate: -DCURL_USE_SECTRANSP=ON -DENABLE_DEBUG=ON
|
||||
macos-version-min: '10.8'
|
||||
@ -184,11 +185,12 @@ jobs:
|
||||
run: |
|
||||
echo ${{ matrix.build.generate && 'ninja' || 'automake libtool' }} \
|
||||
pkgconf libpsl libssh2 \
|
||||
${{ !matrix.build.clang-tidy && 'nghttp2 stunnel' || '' }} \
|
||||
${{ !matrix.build.clang-tidy && 'libnghttp2 stunnel' || '' }} \
|
||||
${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
|
||||
while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done
|
||||
|
||||
- name: 'brew unlink openssl'
|
||||
if: ${{ contains(matrix.build.install, 'libressl') || contains(matrix.build.install, 'quictls') }}
|
||||
run: |
|
||||
if test -d $(brew --prefix)/include/openssl; then
|
||||
brew unlink openssl
|
||||
@ -343,7 +345,7 @@ jobs:
|
||||
if: ${{ contains(matrix.build.name, '+examples') }}
|
||||
run: |
|
||||
if [ -n '${{ matrix.build.generate }}' ]; then
|
||||
cmake --build bld --target curl-examples --verbose
|
||||
cmake --build bld --verbose --target curl-examples
|
||||
else
|
||||
make -C bld examples V=1
|
||||
fi
|
||||
|
||||
4
.github/workflows/non-native.yml
vendored
4
.github/workflows/non-native.yml
vendored
@ -300,7 +300,7 @@ jobs:
|
||||
|
||||
- name: 'cache libressl'
|
||||
if: contains(matrix.build.install_steps, 'libressl')
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-libressl
|
||||
env:
|
||||
cache-name: cache-libressl
|
||||
@ -631,7 +631,7 @@ jobs:
|
||||
run: sudo apt-get -o Dpkg::Use-Pty=0 install libfl2 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }}
|
||||
|
||||
- name: 'cache compiler (djgpp)'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-compiler
|
||||
with:
|
||||
path: ~/djgpp
|
||||
|
||||
4
.github/workflows/windows.yml
vendored
4
.github/workflows/windows.yml
vendored
@ -400,7 +400,7 @@ jobs:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: 'cache compiler (gcc ${{ matrix.env }})'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-compiler
|
||||
with:
|
||||
path: ~\my-cache
|
||||
@ -610,7 +610,7 @@ jobs:
|
||||
while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done
|
||||
|
||||
- name: 'cache compiler (mingw32ce)'
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
|
||||
id: cache-compiler
|
||||
with:
|
||||
path: ~/opt/mingw32ce
|
||||
|
||||
@ -352,13 +352,12 @@ endif()
|
||||
if(WIN32)
|
||||
option(CURL_STATIC_CRT "Build libcurl with static CRT with MSVC (/MT)" OFF)
|
||||
if(CURL_STATIC_CRT AND MSVC)
|
||||
if(BUILD_STATIC_CURL)
|
||||
if(BUILD_STATIC_CURL OR NOT BUILD_CURL_EXE)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
string(APPEND CMAKE_C_FLAGS_RELEASE " -MT")
|
||||
string(APPEND CMAKE_C_FLAGS_DEBUG " -MTd")
|
||||
else()
|
||||
message(WARNING "Static CRT requires curl executable built with static libcurl "
|
||||
"(BUILD_STATIC_LIBS=ON and BUILD_STATIC_CURL=ON).")
|
||||
message(WARNING "Static CRT requires static or no curl executable.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -1954,22 +1953,6 @@ endif()
|
||||
|
||||
# Some other minor tests
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC AND APPLE)
|
||||
include(CheckCCompilerFlag)
|
||||
check_c_compiler_flag("-Wno-long-double" HAVE_C_FLAG_Wno_long_double)
|
||||
if(HAVE_C_FLAG_Wno_long_double)
|
||||
# The Mac version of GCC warns about use of long double. Disable it.
|
||||
get_source_file_property(_mprintf_compile_flags "mprintf.c" COMPILE_FLAGS)
|
||||
if(_mprintf_compile_flags)
|
||||
string(APPEND _mprintf_compile_flags " -Wno-long-double")
|
||||
else()
|
||||
set(_mprintf_compile_flags "-Wno-long-double")
|
||||
endif()
|
||||
set_source_files_properties("mprintf.c" PROPERTIES
|
||||
COMPILE_FLAGS ${_mprintf_compile_flags})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(_cmake_try_compile_target_type_save)
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_cmake_try_compile_target_type_save})
|
||||
unset(_cmake_try_compile_target_type_save)
|
||||
|
||||
@ -238,7 +238,7 @@ target_link_libraries(my_target PRIVATE CURL::libcurl)
|
||||
- `CURL_LIBCURL_VERSIONED_SYMBOLS`: Enable libcurl versioned symbols. Default: `OFF`
|
||||
- `CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX`: Override default versioned symbol prefix. Default: `<TLS-BACKEND>_` or `MULTISSL_`
|
||||
- `CURL_LTO`: Enable compiler Link Time Optimizations. Default: `OFF`
|
||||
- `CURL_STATIC_CRT`: Build libcurl with static CRT with MSVC (`/MT`) (requires static curl executable). Default: `OFF`
|
||||
- `CURL_STATIC_CRT`: Build libcurl with static CRT with MSVC (`/MT`) (requires static or no curl executable). Default: `OFF`
|
||||
- `CURL_TARGET_WINDOWS_VERSION`: Minimum target Windows version as hex string.
|
||||
- `CURL_TEST_BUNDLES`: Bundle `libtest` and `unittest` tests into single binaries. Default: `OFF`
|
||||
- `CURL_WERROR`: Turn compiler warnings into errors. Default: `OFF`
|
||||
|
||||
@ -247,11 +247,11 @@ local system or network, the bar is raised. If a local user wrongfully has
|
||||
elevated rights on your system enough to attack curl, they can probably
|
||||
already do much worse harm and the problem is not really in curl.
|
||||
|
||||
## Experiments
|
||||
## Debug & Experiments
|
||||
|
||||
Vulnerabilities in features which are off by default (in the build) and
|
||||
documented as experimental, are not eligible for a reward and we do not
|
||||
consider them security problems.
|
||||
documented as experimental, or exist only in debug mode, are not eligible for a
|
||||
reward and we do not consider them security problems.
|
||||
|
||||
## URL inconsistencies
|
||||
|
||||
|
||||
@ -298,14 +298,19 @@ int main(void)
|
||||
|
||||
filter = (struct connection_filter *)calloc(1, sizeof(*filter));
|
||||
if(!filter)
|
||||
exit(1);
|
||||
return 1;
|
||||
|
||||
if(curl_global_init(CURL_GLOBAL_DEFAULT))
|
||||
exit(1);
|
||||
if(curl_global_init(CURL_GLOBAL_DEFAULT)) {
|
||||
free(filter);
|
||||
return 1;
|
||||
}
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(!curl)
|
||||
exit(1);
|
||||
if(!curl) {
|
||||
curl_global_cleanup();
|
||||
free(filter);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Set the target URL */
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://localhost");
|
||||
|
||||
@ -79,12 +79,12 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr,
|
||||
"\rUsage: %s [-m=1|2|5|10|20|50|100] [-t] [-x] [url]\n",
|
||||
appname);
|
||||
exit(1);
|
||||
return 1;
|
||||
case 'v':
|
||||
case 'V':
|
||||
fprintf(stderr, "\r%s %s - %s\n",
|
||||
appname, CHKSPEED_VERSION, curl_version());
|
||||
exit(1);
|
||||
return 1;
|
||||
case 'a':
|
||||
case 'A':
|
||||
prtall = 1;
|
||||
|
||||
@ -34,8 +34,7 @@
|
||||
#include <curl/curl.h>
|
||||
#include <curl/mprintf.h>
|
||||
|
||||
static void
|
||||
print_cookies(CURL *curl)
|
||||
static int print_cookies(CURL *curl)
|
||||
{
|
||||
CURLcode res;
|
||||
struct curl_slist *cookies;
|
||||
@ -47,7 +46,7 @@ print_cookies(CURL *curl)
|
||||
if(res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl curl_easy_getinfo failed: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
nc = cookies;
|
||||
i = 1;
|
||||
@ -60,6 +59,8 @@ print_cookies(CURL *curl)
|
||||
printf("(none)\n");
|
||||
}
|
||||
curl_slist_free_all(cookies);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@ -418,22 +418,22 @@ static int init_fifo(GlobalInfo *g)
|
||||
struct epoll_event epev;
|
||||
|
||||
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
|
||||
if(lstat (fifo, &st) == 0) {
|
||||
if(lstat(fifo, &st) == 0) {
|
||||
if((st.st_mode & S_IFMT) == S_IFREG) {
|
||||
errno = EEXIST;
|
||||
perror("lstat");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
unlink(fifo);
|
||||
if(mkfifo (fifo, 0600) == -1) {
|
||||
if(mkfifo(fifo, 0600) == -1) {
|
||||
perror("mkfifo");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
|
||||
if(sockfd == -1) {
|
||||
perror("open");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
g->fifofd = sockfd;
|
||||
@ -449,9 +449,9 @@ static int init_fifo(GlobalInfo *g)
|
||||
|
||||
static void clean_fifo(GlobalInfo *g)
|
||||
{
|
||||
epoll_ctl(g->epfd, EPOLL_CTL_DEL, g->fifofd, NULL);
|
||||
fclose(g->input);
|
||||
unlink(fifo);
|
||||
epoll_ctl(g->epfd, EPOLL_CTL_DEL, g->fifofd, NULL);
|
||||
fclose(g->input);
|
||||
unlink(fifo);
|
||||
}
|
||||
|
||||
|
||||
@ -478,13 +478,13 @@ int main(int argc, char **argv)
|
||||
g.epfd = epoll_create1(EPOLL_CLOEXEC);
|
||||
if(g.epfd == -1) {
|
||||
perror("epoll_create1 failed");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
g.tfd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK | TFD_CLOEXEC);
|
||||
if(g.tfd == -1) {
|
||||
perror("timerfd_create failed");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
memset(&its, 0, sizeof(struct itimerspec));
|
||||
@ -496,7 +496,8 @@ int main(int argc, char **argv)
|
||||
ev.data.fd = g.tfd;
|
||||
epoll_ctl(g.epfd, EPOLL_CTL_ADD, g.tfd, &ev);
|
||||
|
||||
init_fifo(&g);
|
||||
if(init_fifo(&g))
|
||||
return 1;
|
||||
g.multi = curl_multi_init();
|
||||
|
||||
/* setup the generic multi interface options we want */
|
||||
@ -521,7 +522,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else {
|
||||
perror("epoll_wait");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -402,22 +402,22 @@ static int init_fifo(GlobalInfo *g)
|
||||
curl_socket_t sockfd;
|
||||
|
||||
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
|
||||
if(lstat (fifo, &st) == 0) {
|
||||
if(lstat(fifo, &st) == 0) {
|
||||
if((st.st_mode & S_IFMT) == S_IFREG) {
|
||||
errno = EEXIST;
|
||||
perror("lstat");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
unlink(fifo);
|
||||
if(mkfifo (fifo, 0600) == -1) {
|
||||
if(mkfifo(fifo, 0600) == -1) {
|
||||
perror("mkfifo");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
|
||||
if(sockfd == -1) {
|
||||
perror("open");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
g->input = fdopen(sockfd, "r");
|
||||
|
||||
@ -436,7 +436,8 @@ int main(int argc, char **argv)
|
||||
memset(&g, 0, sizeof(GlobalInfo));
|
||||
g.loop = ev_default_loop(0);
|
||||
|
||||
init_fifo(&g);
|
||||
if(init_fifo(&g))
|
||||
return 1;
|
||||
g.multi = curl_multi_init();
|
||||
|
||||
ev_timer_init(&g.timer_event, timer_cb, 0., 0.);
|
||||
|
||||
@ -392,21 +392,21 @@ int init_fifo(void)
|
||||
if((st.st_mode & S_IFMT) == S_IFREG) {
|
||||
errno = EEXIST;
|
||||
perror("lstat");
|
||||
exit(1);
|
||||
return CURL_SOCKET_BAD;
|
||||
}
|
||||
}
|
||||
|
||||
unlink(fifo);
|
||||
if(mkfifo (fifo, 0600) == -1) {
|
||||
if(mkfifo(fifo, 0600) == -1) {
|
||||
perror("mkfifo");
|
||||
exit(1);
|
||||
return CURL_SOCKET_BAD;
|
||||
}
|
||||
|
||||
socket = open(fifo, O_RDWR | O_NONBLOCK, 0);
|
||||
|
||||
if(socket == -1) {
|
||||
if(socket == CURL_SOCKET_BAD) {
|
||||
perror("open");
|
||||
exit(1);
|
||||
return socket;
|
||||
}
|
||||
MSG_OUT("Now, pipe some URL's into > %s\n", fifo);
|
||||
|
||||
@ -421,6 +421,8 @@ int main(void)
|
||||
GIOChannel* ch;
|
||||
|
||||
fd = init_fifo();
|
||||
if(fd == CURL_SOCKET_BAD)
|
||||
return 1;
|
||||
ch = g_io_channel_unix_new(fd);
|
||||
g_io_add_watch(ch, G_IO_IN, fifo_cb, g);
|
||||
gmain = g_main_loop_new(NULL, FALSE);
|
||||
|
||||
@ -399,22 +399,22 @@ static int init_fifo(GlobalInfo *g)
|
||||
curl_socket_t sockfd;
|
||||
|
||||
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
|
||||
if(lstat (fifo, &st) == 0) {
|
||||
if(lstat(fifo, &st) == 0) {
|
||||
if((st.st_mode & S_IFMT) == S_IFREG) {
|
||||
errno = EEXIST;
|
||||
perror("lstat");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
unlink(fifo);
|
||||
if(mkfifo (fifo, 0600) == -1) {
|
||||
perror("mkfifo");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
|
||||
if(sockfd == -1) {
|
||||
perror("open");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
g->input = fdopen(sockfd, "r");
|
||||
|
||||
@ -440,7 +440,8 @@ int main(int argc, char **argv)
|
||||
|
||||
memset(&g, 0, sizeof(GlobalInfo));
|
||||
g.evbase = event_base_new();
|
||||
init_fifo(&g);
|
||||
if(init_fifo(&g))
|
||||
return 1;
|
||||
g.multi = curl_multi_init();
|
||||
evtimer_assign(&g.timer_event, g.evbase, timer_cb, &g);
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ static bool init(CURL *&conn, const char *url)
|
||||
|
||||
if(conn == NULL) {
|
||||
fprintf(stderr, "Failed to create CURL connection\n");
|
||||
exit(EXIT_FAILURE);
|
||||
return false;
|
||||
}
|
||||
|
||||
code = curl_easy_setopt(conn, CURLOPT_ERRORBUFFER, errorBuffer);
|
||||
@ -270,7 +270,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if(argc != 2) {
|
||||
fprintf(stderr, "Usage: %s <url>\n", argv[0]);
|
||||
exit(EXIT_FAILURE);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
@ -279,7 +279,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if(!init(conn, argv[1])) {
|
||||
fprintf(stderr, "Connection initialization failed\n");
|
||||
exit(EXIT_FAILURE);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Retrieve content for the URL
|
||||
@ -289,7 +289,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if(code != CURLE_OK) {
|
||||
fprintf(stderr, "Failed to get '%s' [%s]\n", argv[1], errorBuffer);
|
||||
exit(EXIT_FAILURE);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Parse the (assumed) HTML code
|
||||
|
||||
@ -142,7 +142,7 @@ int my_trace(CURL *handle, curl_infotype type,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void setup(struct transfer *t, int num)
|
||||
static int setup(struct transfer *t, int num)
|
||||
{
|
||||
char filename[128];
|
||||
CURL *hnd;
|
||||
@ -155,7 +155,7 @@ static void setup(struct transfer *t, int num)
|
||||
if(!t->out) {
|
||||
fprintf(stderr, "error: could not open file %s for writing: %s\n",
|
||||
filename, strerror(errno));
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* write to this file */
|
||||
@ -179,6 +179,7 @@ static void setup(struct transfer *t, int num)
|
||||
/* wait for pipe connection to confirm */
|
||||
curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -204,7 +205,8 @@ int main(int argc, char **argv)
|
||||
multi_handle = curl_multi_init();
|
||||
|
||||
for(i = 0; i < num_transfers; i++) {
|
||||
setup(&trans[i], i);
|
||||
if(setup(&trans[i], i))
|
||||
return 1;
|
||||
|
||||
/* add the individual transfer */
|
||||
curl_multi_add_handle(multi_handle, trans[i].easy);
|
||||
|
||||
@ -200,7 +200,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp)
|
||||
return retcode;
|
||||
}
|
||||
|
||||
static void setup(struct input *i, int num, const char *upload)
|
||||
static int setup(struct input *i, int num, const char *upload)
|
||||
{
|
||||
FILE *out;
|
||||
char url[256];
|
||||
@ -209,14 +209,15 @@ static void setup(struct input *i, int num, const char *upload)
|
||||
curl_off_t uploadsize;
|
||||
CURL *hnd;
|
||||
|
||||
hnd = i->hnd = curl_easy_init();
|
||||
hnd = i->hnd = NULL;
|
||||
|
||||
i->num = num;
|
||||
curl_msnprintf(filename, 128, "dl-%d", num);
|
||||
out = fopen(filename, "wb");
|
||||
if(!out) {
|
||||
fprintf(stderr, "error: could not open file %s for writing: %s\n", upload,
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
curl_msnprintf(url, 256, "https://localhost:8443/upload-%d", num);
|
||||
@ -225,7 +226,8 @@ static void setup(struct input *i, int num, const char *upload)
|
||||
if(stat(upload, &file_info)) {
|
||||
fprintf(stderr, "error: could not stat file %s: %s\n", upload,
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
fclose(out);
|
||||
return 1;
|
||||
}
|
||||
|
||||
uploadsize = file_info.st_size;
|
||||
@ -234,9 +236,12 @@ static void setup(struct input *i, int num, const char *upload)
|
||||
if(!i->in) {
|
||||
fprintf(stderr, "error: could not open file %s for reading: %s\n", upload,
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
fclose(out);
|
||||
return 1;
|
||||
}
|
||||
|
||||
hnd = i->hnd = curl_easy_init();
|
||||
|
||||
/* write to this file */
|
||||
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out);
|
||||
|
||||
@ -269,6 +274,7 @@ static void setup(struct input *i, int num, const char *upload)
|
||||
/* wait for pipe connection to confirm */
|
||||
curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -301,7 +307,8 @@ int main(int argc, char **argv)
|
||||
multi_handle = curl_multi_init();
|
||||
|
||||
for(i = 0; i < num_transfers; i++) {
|
||||
setup(&trans[i], i, filename);
|
||||
if(setup(&trans[i], i, filename))
|
||||
return 1;
|
||||
|
||||
/* add the individual transfer */
|
||||
curl_multi_add_handle(multi_handle, trans[i].hnd);
|
||||
|
||||
@ -592,7 +592,7 @@ static void query_completed_cb(void *arg, /* (struct connectdata *) */
|
||||
res->num_pending--;
|
||||
|
||||
if(CURL_ASYNC_SUCCESS == status) {
|
||||
struct Curl_addrinfo *ai = Curl_he2ai(hostent, data->conn->localport);
|
||||
struct Curl_addrinfo *ai = Curl_he2ai(hostent, data->conn->remote_port);
|
||||
if(ai) {
|
||||
compound_results(res, ai);
|
||||
}
|
||||
|
||||
@ -959,7 +959,7 @@ static CURLcode gtls_client_init(struct Curl_cfilter *cf,
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
}
|
||||
else if(ssl_config->key_passwd) {
|
||||
else {
|
||||
const unsigned int supported_key_encryption_algorithms =
|
||||
GNUTLS_PKCS_USE_PKCS12_3DES | GNUTLS_PKCS_USE_PKCS12_ARCFOUR |
|
||||
GNUTLS_PKCS_USE_PKCS12_RC2_40 | GNUTLS_PKCS_USE_PBES2_3DES |
|
||||
@ -974,22 +974,12 @@ static CURLcode gtls_client_init(struct Curl_cfilter *cf,
|
||||
supported_key_encryption_algorithms);
|
||||
if(rc != GNUTLS_E_SUCCESS) {
|
||||
failf(data,
|
||||
"error reading X.509 potentially-encrypted key file: %s",
|
||||
"error reading X.509 %skey file: %s",
|
||||
ssl_config->key_passwd ? "potentially-encrypted " : "",
|
||||
gnutls_strerror(rc));
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(gnutls_certificate_set_x509_key_file(
|
||||
gtls->shared_creds->creds,
|
||||
config->clientcert,
|
||||
ssl_config->key ? ssl_config->key : config->clientcert,
|
||||
gnutls_do_file_type(ssl_config->cert_type) ) !=
|
||||
GNUTLS_E_SUCCESS) {
|
||||
failf(data, "error reading X.509 key or certificate file");
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_GNUTLS_SRP
|
||||
|
||||
@ -482,7 +482,7 @@ AC_DEFUN([CURL_COMPILER_WORKS_IFELSE], [
|
||||
#endif
|
||||
]],[[
|
||||
int i = 0;
|
||||
exit(i);
|
||||
return i;
|
||||
]])
|
||||
],[
|
||||
tmp_compiler_works="yes"
|
||||
|
||||
@ -1270,11 +1270,12 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [
|
||||
struct addrinfo hints;
|
||||
struct addrinfo *ai = 0;
|
||||
int error;
|
||||
int exitcode;
|
||||
|
||||
#ifdef _WIN32
|
||||
WSADATA wsa;
|
||||
if(WSAStartup(MAKEWORD(2, 2), &wsa))
|
||||
exit(2);
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
@ -1283,9 +1284,15 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
error = getaddrinfo("127.0.0.1", 0, &hints, &ai);
|
||||
if(error || !ai)
|
||||
exit(1); /* fail */
|
||||
else
|
||||
exit(0);
|
||||
exitcode = 1; /* fail */
|
||||
else {
|
||||
freeaddrinfo(ai);
|
||||
exitcode = 0;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
WSACleanup();
|
||||
#endif
|
||||
return exitcode;
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
@ -1883,9 +1890,11 @@ AC_DEFUN([CURL_CHECK_FUNC_GETIFADDRS], [
|
||||
|
||||
error = getifaddrs(&ifa);
|
||||
if(error || !ifa)
|
||||
exit(1); /* fail */
|
||||
else
|
||||
exit(0);
|
||||
return 1; /* fail */
|
||||
else {
|
||||
freeifaddrs(ifa);
|
||||
return 0;
|
||||
}
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
@ -2003,9 +2012,9 @@ AC_DEFUN([CURL_CHECK_FUNC_GMTIME_R], [
|
||||
gmt = gmtime_r(&local, &result);
|
||||
(void)result;
|
||||
if(gmt)
|
||||
exit(0);
|
||||
return 0;
|
||||
else
|
||||
exit(1);
|
||||
return 1;
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
@ -2134,13 +2143,13 @@ AC_DEFUN([CURL_CHECK_FUNC_INET_NTOP], [
|
||||
/* - */
|
||||
ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res));
|
||||
if(!ipv4ptr)
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
if(ipv4ptr != ipv4res)
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
if(!ipv4ptr[0])
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
if(memcmp(ipv4res, "192.168.100.1", 13) != 0)
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
/* - */
|
||||
ipv6res[0] = '\0';
|
||||
memset(ipv6a, 0, sizeof(ipv6a));
|
||||
@ -2158,15 +2167,15 @@ AC_DEFUN([CURL_CHECK_FUNC_INET_NTOP], [
|
||||
/* - */
|
||||
ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res));
|
||||
if(!ipv6ptr)
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
if(ipv6ptr != ipv6res)
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
if(!ipv6ptr[0])
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0)
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
/* - */
|
||||
exit(0);
|
||||
return 0;
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
@ -2286,18 +2295,18 @@ AC_DEFUN([CURL_CHECK_FUNC_INET_PTON], [
|
||||
/* - */
|
||||
memset(ipv4a, 1, sizeof(ipv4a));
|
||||
if(1 != inet_pton(AF_INET, ipv4src, ipv4a))
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
/* - */
|
||||
if( (ipv4a[0] != 0xc0) ||
|
||||
(ipv4a[1] != 0xa8) ||
|
||||
(ipv4a[2] != 0x64) ||
|
||||
(ipv4a[3] != 0x01) ||
|
||||
(ipv4a[4] != 0x01) )
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
/* - */
|
||||
memset(ipv6a, 1, sizeof(ipv6a));
|
||||
if(1 != inet_pton(AF_INET6, ipv6src, ipv6a))
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
/* - */
|
||||
if( (ipv6a[0] != 0xfe) ||
|
||||
(ipv6a[1] != 0x80) ||
|
||||
@ -2310,7 +2319,7 @@ AC_DEFUN([CURL_CHECK_FUNC_INET_PTON], [
|
||||
(ipv6a[14] != 0x76) ||
|
||||
(ipv6a[15] != 0xc8) ||
|
||||
(ipv6a[16] != 0x01) )
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
/* - */
|
||||
if( (ipv6a[2] != 0x0) ||
|
||||
(ipv6a[3] != 0x0) ||
|
||||
@ -2318,9 +2327,9 @@ AC_DEFUN([CURL_CHECK_FUNC_INET_PTON], [
|
||||
(ipv6a[5] != 0x0) ||
|
||||
(ipv6a[6] != 0x0) ||
|
||||
(ipv6a[7] != 0x0) )
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
/* - */
|
||||
exit(0);
|
||||
return 0;
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
@ -3809,11 +3818,11 @@ AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [
|
||||
buffer[0] = '\0';
|
||||
string = strerror_r(EACCES, buffer, sizeof(buffer));
|
||||
if(!string)
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
if(!string[0])
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
else
|
||||
exit(0);
|
||||
return 0;
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
@ -3872,11 +3881,11 @@ AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [
|
||||
buffer[0] = '\0';
|
||||
error = strerror_r(EACCES, buffer, sizeof(buffer));
|
||||
if(error)
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
if(buffer[0] == '\0')
|
||||
exit(1); /* fail */
|
||||
return 1; /* fail */
|
||||
else
|
||||
exit(0);
|
||||
return 0;
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
@ -48,7 +48,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if(argc < 1) {
|
||||
puts("report_openssl_version filename");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
libptr = dlopen(argv[1], 0);
|
||||
@ -65,7 +65,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if(!ssl_version) {
|
||||
puts("Unable to lookup version of OpenSSL");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
version = ssl_version(SSLEAY_VERSION);
|
||||
@ -91,9 +91,9 @@ int main(int argc, char **argv)
|
||||
|
||||
status = LIB$SET_SYMBOL(&symbol_dsc, &value_dsc, &table_type);
|
||||
if(!$VMS_STATUS_SUCCESS(status)) {
|
||||
exit(status);
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ http
|
||||
Download two URLs provided on stdin
|
||||
</name>
|
||||
<command>
|
||||
--url @-
|
||||
--output-dir %LOGDIR --url @-
|
||||
</command>
|
||||
<stdin>
|
||||
http://%HOSTIP:%HTTPPORT/a
|
||||
|
||||
@ -34,7 +34,7 @@ if(NOT VSFTPD)
|
||||
endif()
|
||||
mark_as_advanced(VSFTPD)
|
||||
|
||||
find_program(HTTPD "apache2") # /usr/sbin/apache2
|
||||
find_program(HTTPD NAMES "/usr/sbin/apache2" "httpd" "apache2")
|
||||
if(NOT HTTPD)
|
||||
set(HTTPD "")
|
||||
endif()
|
||||
|
||||
@ -140,12 +140,6 @@ static int debug_cb(CURL *handle, curl_infotype type,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define ERR() \
|
||||
do { \
|
||||
fprintf(stderr, "something unexpected went wrong - bailing out!\n"); \
|
||||
exit(2); \
|
||||
} while(0)
|
||||
|
||||
static void usage(const char *msg)
|
||||
{
|
||||
if(msg)
|
||||
@ -196,6 +190,13 @@ static size_t cb(char *data, size_t size, size_t nmemb, void *clientp)
|
||||
handle->idx, (long)realsize);
|
||||
return realsize;
|
||||
}
|
||||
|
||||
#define ERR() \
|
||||
do { \
|
||||
fprintf(stderr, "something unexpected went wrong - bailing out!\n"); \
|
||||
return 2; \
|
||||
} while(0)
|
||||
|
||||
#endif /* !_MSC_VER */
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@ -254,19 +255,19 @@ int main(int argc, char *argv[])
|
||||
cu = curl_url();
|
||||
if(!cu) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
if(curl_url_set(cu, CURLUPART_URL, url, 0)) {
|
||||
fprintf(stderr, "not a URL: '%s'\n", url);
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
if(curl_url_get(cu, CURLUPART_HOST, &host, 0)) {
|
||||
fprintf(stderr, "could not get host of '%s'\n", url);
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
if(curl_url_get(cu, CURLUPART_PORT, &port, 0)) {
|
||||
fprintf(stderr, "could not get port of '%s'\n", url);
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
memset(&resolve, 0, sizeof(resolve));
|
||||
curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, "%s:%s:127.0.0.1",
|
||||
|
||||
@ -138,24 +138,25 @@ static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *opaque)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char *url;
|
||||
CURLM *multi;
|
||||
CURLM *multi = NULL;
|
||||
CURL *easy;
|
||||
CURLMcode mc;
|
||||
int running_handles = 0, start_count, numfds;
|
||||
CURLMsg *msg;
|
||||
int msgs_in_queue;
|
||||
char range[128];
|
||||
int exitcode = 1;
|
||||
|
||||
if(argc != 2) {
|
||||
fprintf(stderr, "%s URL\n", argv[0]);
|
||||
exit(2);
|
||||
return 2;
|
||||
}
|
||||
|
||||
url = argv[1];
|
||||
multi = curl_multi_init();
|
||||
if(!multi) {
|
||||
fprintf(stderr, "curl_multi_init failed\n");
|
||||
exit(1);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
start_count = 200;
|
||||
@ -164,7 +165,7 @@ int main(int argc, char *argv[])
|
||||
easy = curl_easy_init();
|
||||
if(!easy) {
|
||||
fprintf(stderr, "curl_easy_init failed\n");
|
||||
exit(1);
|
||||
goto cleanup;
|
||||
}
|
||||
curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(easy, CURLOPT_DEBUGFUNCTION, debug_cb);
|
||||
@ -186,8 +187,9 @@ int main(int argc, char *argv[])
|
||||
mc = curl_multi_add_handle(multi, easy);
|
||||
if(mc != CURLM_OK) {
|
||||
fprintf(stderr, "curl_multi_add_handle: %s\n",
|
||||
curl_multi_strerror(mc));
|
||||
exit(1);
|
||||
curl_multi_strerror(mc));
|
||||
curl_easy_cleanup(easy);
|
||||
goto cleanup;
|
||||
}
|
||||
--start_count;
|
||||
}
|
||||
@ -195,16 +197,16 @@ int main(int argc, char *argv[])
|
||||
mc = curl_multi_perform(multi, &running_handles);
|
||||
if(mc != CURLM_OK) {
|
||||
fprintf(stderr, "curl_multi_perform: %s\n",
|
||||
curl_multi_strerror(mc));
|
||||
exit(1);
|
||||
curl_multi_strerror(mc));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if(running_handles) {
|
||||
mc = curl_multi_poll(multi, NULL, 0, 1000000, &numfds);
|
||||
if(mc != CURLM_OK) {
|
||||
fprintf(stderr, "curl_multi_poll: %s\n",
|
||||
curl_multi_strerror(mc));
|
||||
exit(1);
|
||||
curl_multi_strerror(mc));
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
@ -224,12 +226,12 @@ int main(int argc, char *argv[])
|
||||
else if(msg->data.result) {
|
||||
fprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T
|
||||
": failed with %d\n", xfer_id, msg->data.result);
|
||||
exit(1);
|
||||
goto cleanup;
|
||||
}
|
||||
else if(status != 206) {
|
||||
fprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T
|
||||
": wrong http status %ld (expected 206)\n", xfer_id, status);
|
||||
exit(1);
|
||||
goto cleanup;
|
||||
}
|
||||
curl_multi_remove_handle(multi, msg->easy_handle);
|
||||
curl_easy_cleanup(msg->easy_handle);
|
||||
@ -244,5 +246,22 @@ int main(int argc, char *argv[])
|
||||
} while(running_handles > 0 || start_count);
|
||||
|
||||
fprintf(stderr, "exiting\n");
|
||||
exit(EXIT_SUCCESS);
|
||||
exitcode = EXIT_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
|
||||
if(multi) {
|
||||
CURL **list = curl_multi_get_handles(multi);
|
||||
if(list) {
|
||||
int i;
|
||||
for(i = 0; list[i]; i++) {
|
||||
curl_multi_remove_handle(multi, list[i]);
|
||||
curl_easy_cleanup(list[i]);
|
||||
}
|
||||
curl_free(list);
|
||||
}
|
||||
curl_multi_cleanup(multi);
|
||||
}
|
||||
|
||||
return exitcode;
|
||||
}
|
||||
|
||||
@ -136,9 +136,9 @@ static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *opaque)
|
||||
return size * nmemb;
|
||||
}
|
||||
|
||||
static void add_transfer(CURLM *multi, CURLSH *share,
|
||||
struct curl_slist *resolve,
|
||||
const char *url, int http_version)
|
||||
static int add_transfer(CURLM *multi, CURLSH *share,
|
||||
struct curl_slist *resolve,
|
||||
const char *url, int http_version)
|
||||
{
|
||||
CURL *easy;
|
||||
CURLMcode mc;
|
||||
@ -146,7 +146,7 @@ static void add_transfer(CURLM *multi, CURLSH *share,
|
||||
easy = curl_easy_init();
|
||||
if(!easy) {
|
||||
fprintf(stderr, "curl_easy_init failed\n");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(easy, CURLOPT_DEBUGFUNCTION, debug_cb);
|
||||
@ -167,30 +167,33 @@ static void add_transfer(CURLM *multi, CURLSH *share,
|
||||
mc = curl_multi_add_handle(multi, easy);
|
||||
if(mc != CURLM_OK) {
|
||||
fprintf(stderr, "curl_multi_add_handle: %s\n",
|
||||
curl_multi_strerror(mc));
|
||||
exit(1);
|
||||
curl_multi_strerror(mc));
|
||||
curl_easy_cleanup(easy);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char *url;
|
||||
CURLM *multi;
|
||||
CURLM *multi = NULL;
|
||||
CURLMcode mc;
|
||||
int running_handles = 0, numfds;
|
||||
CURLMsg *msg;
|
||||
CURLSH *share;
|
||||
CURLSH *share = NULL;
|
||||
CURLU *cu;
|
||||
struct curl_slist resolve;
|
||||
struct curl_slist *resolve = NULL;
|
||||
char resolve_buf[1024];
|
||||
int msgs_in_queue;
|
||||
int add_more, waits, ongoing = 0;
|
||||
char *host, *port;
|
||||
char *host = NULL, *port = NULL;
|
||||
int http_version = CURL_HTTP_VERSION_1_1;
|
||||
int exitcode = 1;
|
||||
|
||||
if(argc != 3) {
|
||||
fprintf(stderr, "%s proto URL\n", argv[0]);
|
||||
exit(2);
|
||||
return 2;
|
||||
}
|
||||
|
||||
if(!strcmp("h2", argv[1]))
|
||||
@ -202,41 +205,41 @@ int main(int argc, char *argv[])
|
||||
cu = curl_url();
|
||||
if(!cu) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
if(curl_url_set(cu, CURLUPART_URL, url, 0)) {
|
||||
fprintf(stderr, "not a URL: '%s'\n", url);
|
||||
exit(1);
|
||||
goto cleanup;
|
||||
}
|
||||
if(curl_url_get(cu, CURLUPART_HOST, &host, 0)) {
|
||||
fprintf(stderr, "could not get host of '%s'\n", url);
|
||||
exit(1);
|
||||
goto cleanup;
|
||||
}
|
||||
if(curl_url_get(cu, CURLUPART_PORT, &port, 0)) {
|
||||
fprintf(stderr, "could not get port of '%s'\n", url);
|
||||
exit(1);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
memset(&resolve, 0, sizeof(resolve));
|
||||
curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, "%s:%s:127.0.0.1",
|
||||
host, port);
|
||||
curl_slist_append(&resolve, resolve_buf);
|
||||
resolve = curl_slist_append(resolve, resolve_buf);
|
||||
|
||||
multi = curl_multi_init();
|
||||
if(!multi) {
|
||||
fprintf(stderr, "curl_multi_init failed\n");
|
||||
exit(1);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
share = curl_share_init();
|
||||
if(!share) {
|
||||
fprintf(stderr, "curl_share_init failed\n");
|
||||
exit(1);
|
||||
goto cleanup;
|
||||
}
|
||||
curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION);
|
||||
|
||||
|
||||
add_transfer(multi, share, &resolve, url, http_version);
|
||||
if(add_transfer(multi, share, resolve, url, http_version))
|
||||
goto cleanup;
|
||||
++ongoing;
|
||||
add_more = 6;
|
||||
waits = 3;
|
||||
@ -244,16 +247,16 @@ int main(int argc, char *argv[])
|
||||
mc = curl_multi_perform(multi, &running_handles);
|
||||
if(mc != CURLM_OK) {
|
||||
fprintf(stderr, "curl_multi_perform: %s\n",
|
||||
curl_multi_strerror(mc));
|
||||
exit(1);
|
||||
curl_multi_strerror(mc));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if(running_handles) {
|
||||
mc = curl_multi_poll(multi, NULL, 0, 1000000, &numfds);
|
||||
if(mc != CURLM_OK) {
|
||||
fprintf(stderr, "curl_multi_poll: %s\n",
|
||||
curl_multi_strerror(mc));
|
||||
exit(1);
|
||||
curl_multi_strerror(mc));
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
@ -262,7 +265,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else {
|
||||
while(add_more) {
|
||||
add_transfer(multi, share, &resolve, url, http_version);
|
||||
if(add_transfer(multi, share, resolve, url, http_version))
|
||||
goto cleanup;
|
||||
++ongoing;
|
||||
--add_more;
|
||||
}
|
||||
@ -284,12 +288,12 @@ int main(int argc, char *argv[])
|
||||
else if(msg->data.result) {
|
||||
fprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T
|
||||
": failed with %d\n", xfer_id, msg->data.result);
|
||||
exit(1);
|
||||
goto cleanup;
|
||||
}
|
||||
else if(status != 200) {
|
||||
fprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T
|
||||
": wrong http status %ld (expected 200)\n", xfer_id, status);
|
||||
exit(1);
|
||||
goto cleanup;
|
||||
}
|
||||
curl_multi_remove_handle(multi, msg->easy_handle);
|
||||
curl_easy_cleanup(msg->easy_handle);
|
||||
@ -305,5 +309,27 @@ int main(int argc, char *argv[])
|
||||
} while(ongoing || add_more);
|
||||
|
||||
fprintf(stderr, "exiting\n");
|
||||
exit(EXIT_SUCCESS);
|
||||
exitcode = EXIT_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
|
||||
if(multi) {
|
||||
CURL **list = curl_multi_get_handles(multi);
|
||||
if(list) {
|
||||
int i;
|
||||
for(i = 0; list[i]; i++) {
|
||||
curl_multi_remove_handle(multi, list[i]);
|
||||
curl_easy_cleanup(list[i]);
|
||||
}
|
||||
curl_free(list);
|
||||
}
|
||||
curl_multi_cleanup(multi);
|
||||
}
|
||||
curl_share_cleanup(share);
|
||||
curl_slist_free_all(resolve);
|
||||
curl_free(host);
|
||||
curl_free(port);
|
||||
curl_url_cleanup(cu);
|
||||
|
||||
return exitcode;
|
||||
}
|
||||
|
||||
@ -180,12 +180,6 @@ static int progress_callback(void *clientp,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define ERR() \
|
||||
do { \
|
||||
fprintf(stderr, "something unexpected went wrong - bailing out!\n"); \
|
||||
exit(2); \
|
||||
} while(0)
|
||||
|
||||
static void usage(const char *msg)
|
||||
{
|
||||
if(msg)
|
||||
@ -196,6 +190,13 @@ static void usage(const char *msg)
|
||||
" -V http_version (http/1.1, h2, h3) http version to use\n"
|
||||
);
|
||||
}
|
||||
|
||||
#define ERR() \
|
||||
do { \
|
||||
fprintf(stderr, "something unexpected went wrong - bailing out!\n"); \
|
||||
return 2; \
|
||||
} while(0)
|
||||
|
||||
#endif /* !_MSC_VER */
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@ -245,19 +246,19 @@ int main(int argc, char *argv[])
|
||||
cu = curl_url();
|
||||
if(!cu) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
if(curl_url_set(cu, CURLUPART_URL, url, 0)) {
|
||||
fprintf(stderr, "not a URL: '%s'\n", url);
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
if(curl_url_get(cu, CURLUPART_HOST, &host, 0)) {
|
||||
fprintf(stderr, "could not get host of '%s'\n", url);
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
if(curl_url_get(cu, CURLUPART_PORT, &port, 0)) {
|
||||
fprintf(stderr, "could not get port of '%s'\n", url);
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
memset(&resolve, 0, sizeof(resolve));
|
||||
curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, "%s:%s:127.0.0.1",
|
||||
@ -267,7 +268,7 @@ int main(int argc, char *argv[])
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
/* We want to use our own read function. */
|
||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
/* used for test case 533, 534 and 535 */
|
||||
/* used for test case 533, 534, 535 and 546 */
|
||||
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1018,8 +1018,8 @@ int main(int argc, char *argv[])
|
||||
logdir, SERVERLOGS_LOCKDIR, ipv_inuse);
|
||||
|
||||
#ifdef _WIN32
|
||||
win32_init();
|
||||
atexit(win32_cleanup);
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
CURL_SET_BINMODE(stdin);
|
||||
|
||||
@ -99,8 +99,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
win32_init();
|
||||
atexit(win32_cleanup);
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
#if defined(CURLRES_IPV6)
|
||||
|
||||
@ -1145,8 +1145,8 @@ int main(int argc, char *argv[])
|
||||
logdir, SERVERLOGS_LOCKDIR, ipv_inuse);
|
||||
|
||||
#ifdef _WIN32
|
||||
win32_init();
|
||||
atexit(win32_cleanup);
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
install_signal_handlers(false);
|
||||
|
||||
@ -1507,8 +1507,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
win32_init();
|
||||
atexit(win32_cleanup);
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
CURL_SET_BINMODE(stdin);
|
||||
|
||||
@ -1086,8 +1086,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
win32_init();
|
||||
atexit(win32_cleanup);
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
CURL_SET_BINMODE(stdin);
|
||||
|
||||
@ -1611,7 +1611,7 @@ static void http_connect(curl_socket_t *infdp,
|
||||
if(!req2) {
|
||||
req2 = malloc(sizeof(*req2));
|
||||
if(!req2)
|
||||
exit(1);
|
||||
goto http_connect_cleanup; /* fail */
|
||||
}
|
||||
memset(req2, 0, sizeof(*req2));
|
||||
logmsg("====> Client connect DATA");
|
||||
@ -2207,8 +2207,8 @@ int main(int argc, char *argv[])
|
||||
is_proxy ? "-proxy" : "", socket_type);
|
||||
|
||||
#ifdef _WIN32
|
||||
win32_init();
|
||||
atexit(win32_cleanup);
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
install_signal_handlers(false);
|
||||
|
||||
@ -644,8 +644,8 @@ int main(int argc, char **argv)
|
||||
logdir, SERVERLOGS_LOCKDIR, ipv_inuse);
|
||||
|
||||
#ifdef _WIN32
|
||||
win32_init();
|
||||
atexit(win32_cleanup);
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
install_signal_handlers(true);
|
||||
|
||||
@ -153,7 +153,17 @@ void win32_perror(const char *msg)
|
||||
fprintf(stderr, "%s\n", buf);
|
||||
}
|
||||
|
||||
void win32_init(void)
|
||||
static void win32_cleanup(void)
|
||||
{
|
||||
#ifdef USE_WINSOCK
|
||||
WSACleanup();
|
||||
#endif /* USE_WINSOCK */
|
||||
|
||||
/* flush buffers of all streams regardless of their mode */
|
||||
_flushall();
|
||||
}
|
||||
|
||||
int win32_init(void)
|
||||
{
|
||||
#ifdef USE_WINSOCK
|
||||
WORD wVersionRequested;
|
||||
@ -166,7 +176,7 @@ void win32_init(void)
|
||||
if(err) {
|
||||
perror("Winsock init failed");
|
||||
logmsg("Error initialising Winsock -- aborting");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(LOBYTE(wsaData.wVersion) != LOBYTE(wVersionRequested) ||
|
||||
@ -174,19 +184,11 @@ void win32_init(void)
|
||||
WSACleanup();
|
||||
perror("Winsock init failed");
|
||||
logmsg("No suitable winsock.dll found -- aborting");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
#endif /* USE_WINSOCK */
|
||||
}
|
||||
|
||||
void win32_cleanup(void)
|
||||
{
|
||||
#ifdef USE_WINSOCK
|
||||
WSACleanup();
|
||||
#endif /* USE_WINSOCK */
|
||||
|
||||
/* flush buffers of all streams regardless of their mode */
|
||||
_flushall();
|
||||
atexit(win32_cleanup);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* socket-safe strerror (works on Winsock errors, too) */
|
||||
|
||||
@ -51,8 +51,7 @@ extern const char *cmdfile;
|
||||
#define perror(m) win32_perror(m)
|
||||
void win32_perror(const char *msg);
|
||||
|
||||
void win32_init(void);
|
||||
void win32_cleanup(void);
|
||||
int win32_init(void);
|
||||
const char *sstrerror(int err);
|
||||
#else /* _WIN32 */
|
||||
|
||||
|
||||
@ -58,9 +58,11 @@ CFGSET=true
|
||||
!ENDIF
|
||||
|
||||
!INCLUDE "../lib/Makefile.inc"
|
||||
CSOURCES=$(CSOURCES: = )
|
||||
LIBCURL_OBJS=$(CSOURCES:.c=.obj)
|
||||
|
||||
!INCLUDE "../src/Makefile.inc"
|
||||
CURL_CFILES=$(CURL_CFILES: = )
|
||||
CURL_OBJS=$(CURL_CFILES:.c=.obj)
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user