Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from curl:master #320

Merged
merged 5 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt

- name: Check Spelling
uses: rojopolis/spellcheck-github-actions@9e0a5fb25a80b89c84899657949cbd6e17eb376c # v0
uses: rojopolis/spellcheck-github-actions@ed0756273a1658136c36d26e3d0353de35b98c8b # v0
with:
config_path: .github/scripts/spellcheck.yaml

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,9 @@ jobs:
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
${{ matrix.build.generate }} ${options}
done
if [ -d bld_chkprefill ]; then
diff -u bld/lib/curl_config.h bld_chkprefill/lib/curl_config.h
if [ -d bld_chkprefill ] && ! diff -u bld/lib/curl_config.h bld_chkprefill/lib/curl_config.h; then
echo '::group::reference configure log'; cat bld_chkprefill/CMakeFiles/CMake*.yaml 2>/dev/null || true; echo '::endgroup::'
false
fi
else
export CFLAGS
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ jobs:
-DCURL_WERROR=ON \
${{ matrix.config }}
done
if [ -d bld_chkprefill ]; then
diff -u bld/lib/curl_config.h bld_chkprefill/lib/curl_config.h
if [ -d bld_chkprefill ] && ! diff -u bld/lib/curl_config.h bld_chkprefill/lib/curl_config.h; then
echo '::group::reference configure log'; cat bld_chkprefill/CMakeFiles/CMake*.yaml 2>/dev/null || true; echo '::endgroup::'
false
fi
else
export CFLAGS CPPFLAGS
Expand Down Expand Up @@ -756,8 +757,9 @@ jobs:
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE= \
${{ matrix.config }}
done
if [ -d bld_chkprefill ]; then
diff -u bld/lib/curl_config.h bld_chkprefill/lib/curl_config.h
if [ -d bld_chkprefill ] && ! diff -u bld/lib/curl_config.h bld_chkprefill/lib/curl_config.h; then
echo '::group::reference configure log'; cat bld_chkprefill/CMakeFiles/CMake*.yaml 2>/dev/null || true; echo '::endgroup::'
false
fi

- name: 'configure log'
Expand Down
36 changes: 18 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ if(CURL_DEFAULT_SSL_BACKEND AND NOT _valid_default_ssl_backend)
endif()

# Keep ZLIB detection after TLS detection,
# and before calling curl_openssl_check_symbol_exists().
# and before calling curl_openssl_check_exists().

set(HAVE_LIBZ OFF)
curl_dependency_option(CURL_ZLIB ZLIB "ZLIB")
Expand Down Expand Up @@ -948,8 +948,8 @@ if(ZSTD_FOUND)
endif()
endif()

# Check symbol in an OpenSSL-like TLS backend.
macro(curl_openssl_check_symbol_exists _symbol _files _variable)
# Check function in an OpenSSL-like TLS backend.
macro(curl_openssl_check_exists)
cmake_push_check_state()
if(USE_OPENSSL)
list(APPEND CMAKE_REQUIRED_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
Expand All @@ -974,19 +974,22 @@ macro(curl_openssl_check_symbol_exists _symbol _files _variable)
endif()
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DHAVE_UINTPTR_T") # to pull in stdint.h (as of wolfSSL v5.5.4)
endif()
check_symbol_exists("${_symbol}" "${_files}" "${_variable}")
if(${ARGC} EQUAL 2)
check_function_exists(${ARGN})
else()
check_symbol_exists(${ARGN}) # Uses CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_DEFINITIONS
endif()
cmake_pop_check_state()
endmacro()

# Ensure that the OpenSSL fork actually supports QUIC.
macro(curl_openssl_check_quic)
if(NOT DEFINED HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT)
if(USE_OPENSSL)
curl_openssl_check_symbol_exists("SSL_set_quic_use_legacy_codepoint" "openssl/ssl.h" HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT)
curl_openssl_check_exists("SSL_set_quic_use_legacy_codepoint" HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT)
endif()
if(USE_WOLFSSL)
curl_openssl_check_symbol_exists("wolfSSL_set_quic_use_legacy_codepoint" "wolfssl/options.h;wolfssl/openssl/ssl.h"
HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT)
curl_openssl_check_exists("wolfSSL_set_quic_use_legacy_codepoint" HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT)
endif()
endif()
if(NOT HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT)
Expand All @@ -995,17 +998,17 @@ macro(curl_openssl_check_quic)
endmacro()

if(USE_WOLFSSL)
curl_openssl_check_symbol_exists("wolfSSL_DES_ecb_encrypt" "wolfssl/options.h;wolfssl/openssl/des.h" HAVE_WOLFSSL_DES_ECB_ENCRYPT)
curl_openssl_check_symbol_exists("wolfSSL_BIO_new" "wolfssl/options.h;wolfssl/ssl.h" HAVE_WOLFSSL_BIO)
curl_openssl_check_symbol_exists("wolfSSL_BIO_set_shutdown" "wolfssl/options.h;wolfssl/ssl.h" HAVE_WOLFSSL_FULL_BIO)
curl_openssl_check_exists("wolfSSL_DES_ecb_encrypt" HAVE_WOLFSSL_DES_ECB_ENCRYPT)
curl_openssl_check_exists("wolfSSL_BIO_new" HAVE_WOLFSSL_BIO)
curl_openssl_check_exists("wolfSSL_BIO_set_shutdown" HAVE_WOLFSSL_FULL_BIO)
endif()

if(USE_OPENSSL)
if(NOT DEFINED HAVE_SSL_SET0_WBIO)
curl_openssl_check_symbol_exists("SSL_set0_wbio" "openssl/ssl.h" HAVE_SSL_SET0_WBIO)
curl_openssl_check_exists("SSL_set0_wbio" HAVE_SSL_SET0_WBIO)
endif()
if(NOT DEFINED HAVE_OPENSSL_SRP AND NOT CURL_DISABLE_SRP)
curl_openssl_check_symbol_exists("SSL_CTX_set_srp_username" "openssl/ssl.h" HAVE_OPENSSL_SRP)
curl_openssl_check_exists("SSL_CTX_set_srp_username" "openssl/ssl.h" HAVE_OPENSSL_SRP)
endif()
endif()

Expand All @@ -1015,13 +1018,10 @@ if(USE_ECH)
if(USE_OPENSSL OR USE_WOLFSSL)
# Be sure that the TLS library actually supports ECH.
if(USE_WOLFSSL)
curl_openssl_check_symbol_exists("wolfSSL_CTX_GenerateEchConfig" "wolfssl/options.h;wolfssl/ssl.h"
HAVE_WOLFSSL_CTX_GENERATEECHCONFIG)
curl_openssl_check_exists("wolfSSL_CTX_GenerateEchConfig" HAVE_WOLFSSL_CTX_GENERATEECHCONFIG)
endif()
if(HAVE_BORINGSSL OR HAVE_AWSLC)
curl_openssl_check_symbol_exists("SSL_set1_ech_config_list" "openssl/ssl.h" HAVE_SSL_SET1_ECH_CONFIG_LIST)
elseif(USE_OPENSSL)
curl_openssl_check_symbol_exists("SSL_set1_ech_config_list" "openssl/ech.h" HAVE_SSL_SET1_ECH_CONFIG_LIST)
if(USE_OPENSSL)
curl_openssl_check_exists("SSL_set1_ech_config_list" HAVE_SSL_SET1_ECH_CONFIG_LIST)
endif()
if(HAVE_WOLFSSL_CTX_GENERATEECHCONFIG OR
HAVE_SSL_SET1_ECH_CONFIG_LIST)
Expand Down
5 changes: 3 additions & 2 deletions appveyor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
-DCMAKE_BUILD_TYPE="${PRJ_CFG}" \
-DCURL_USE_LIBPSL=OFF ${options}
done
if [ -d _bld_chkprefill ]; then
diff -u _bld/lib/curl_config.h _bld_chkprefill/lib/curl_config.h
if [ -d _bld_chkprefill ] && ! diff -u _bld/lib/curl_config.h _bld_chkprefill/lib/curl_config.h; then
cat _bld_chkprefill/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
false
fi
if false; then
cat _bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
Expand Down
8 changes: 3 additions & 5 deletions lib/asyn-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,15 @@ CURL_STDCALL gethostbyname_thread(void *arg)
tsd->sock_error = RESOLVER_ENOMEM;
}

Curl_mutex_acquire(tsd->mtx);
Curl_mutex_acquire(&tsd->mutx);
if(tsd->done) {
/* too late, gotta clean up the mess */
Curl_mutex_release(tsd->mtx);
Curl_mutex_release(&tsd->mutx);
destroy_thread_sync_data(tsd);
}
else {
tsd->done = TRUE;
Curl_mutex_release(tsd->mtx);
Curl_mutex_release(&tsd->mutx);
}

return 0;
Expand Down Expand Up @@ -682,8 +682,6 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data,
int port,
int *waitp)
{
struct thread_data *td = &data->state.async.thdata;

*waitp = 0; /* default to synchronous response */

/* fire up a new resolver thread! */
Expand Down
2 changes: 1 addition & 1 deletion lib/timediff.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ struct timeval *curlx_mstotv(struct timeval *tv, timediff_t ms)
*/
timediff_t curlx_tvtoms(struct timeval *tv)
{
return (tv->tv_sec*1000) + (timediff_t)(((double)tv->tv_usec)/1000.0);
return (tv->tv_sec*1000) + (timediff_t)(tv->tv_usec/1000);
}
Loading