- schannel: delete superfluous parenthesis.
- tftp: delete stray space from log output.
- ws: update guard comment.
- docs/examples: constify variables.
- runtests/servers: enclose unknown parameter between quotes.
- scripts/perlcheck.sh: drop redundant grep `-E` option.
- THANKS: move names from comments to THANKS.
- sync `--depth` option style across scripts.
- sync git repo URL ending between some scripts.
- BINDINGS.md: drop protocol from archive.org URL path.
- whitespace, indent, unfold lines.
Closes #19565
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
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
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 \
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
# 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 \
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 \
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
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 ####
- 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
# 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}")
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 */
check_function_exists("if_nametoindex" HAVE_IF_NAMETOINDEX) # net/if.h
check_function_exists("realpath" HAVE_REALPATH)
check_function_exists("sched_yield" HAVE_SCHED_YIELD)
- check_symbol_exists("strcasecmp" "string.h" HAVE_STRCASECMP)
- check_symbol_exists("stricmp" "string.h" HAVE_STRICMP)
- check_symbol_exists("strcmpi" "string.h" HAVE_STRCMPI)
+ check_symbol_exists("strcasecmp" "string.h" HAVE_STRCASECMP)
+ check_symbol_exists("stricmp" "string.h" HAVE_STRICMP)
+ check_symbol_exists("strcmpi" "string.h" HAVE_STRCMPI)
endif()
check_function_exists("setmode" HAVE_SETMODE)
[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)
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
Ben Kohler
Ben Madsen
Ben Noordhuis
-Benoit Neil
+Benoit Neil (Sukender)
Benoit Pierre
Benoit Sigoure
Ben Van Hof
Terence Eden
Terri Oda
Terry Wu
+Tetetest
thanhchungbtc on github
TheAssassin on github
TheBitBrine
User Sg
ustcqidi on github
Vadim Grinshpun
+Vaibhav Kumar
Valentin David
ValentÃn Gutiérrez
Valentin Richter
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");
}
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;
r = sscanf(ptr, "Content-Length: %ld\n", &len);
if(r == 1)
- *((long *) stream) = len;
+ *((long *)stream) = len;
return size * nmemb;
}
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)
/* take care of the data here, ignored in this example */
(void)data;
(void)userp;
- return n*l;
+ return n * l;
}
int main(void)
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;
#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;
if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE,
(void *)&optval, sizeof(optval)) < 0) {
CURL_TRC_CF(data, cf, "Failed to set SO_KEEPALIVE on fd "
- "%" FMT_SOCKET_T ": errno %d",
- sockfd, SOCKERRNO);
+ "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
else {
#ifdef USE_WINSOCK
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE,
(const char *)&optval, sizeof(optval)) < 0) {
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPIDLE on fd "
- "%" FMT_SOCKET_T ": errno %d",
- sockfd, SOCKERRNO);
+ "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
optval = curlx_sltosi(data->set.tcp_keepintvl);
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL,
(const char *)&optval, sizeof(optval)) < 0) {
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPINTVL on fd "
- "%" FMT_SOCKET_T ": errno %d",
- sockfd, SOCKERRNO);
+ "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
optval = curlx_sltosi(data->set.tcp_keepcnt);
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT,
(const char *)&optval, sizeof(optval)) < 0) {
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPCNT on fd "
- "%" FMT_SOCKET_T ": errno %d",
- sockfd, SOCKERRNO);
+ "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
}
else
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE,
(void *)&optval, sizeof(optval)) < 0) {
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPIDLE on fd "
- "%" FMT_SOCKET_T ": errno %d",
- sockfd, SOCKERRNO);
+ "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
#elif defined(TCP_KEEPALIVE)
/* macOS style */
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE,
(void *)&optval, sizeof(optval)) < 0) {
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE on fd "
- "%" FMT_SOCKET_T ": errno %d",
- sockfd, SOCKERRNO);
+ "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
#elif defined(TCP_KEEPALIVE_THRESHOLD)
/* Solaris <11.4 style */
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE_THRESHOLD,
(void *)&optval, sizeof(optval)) < 0) {
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE_THRESHOLD on fd "
- "%" FMT_SOCKET_T ": errno %d",
- sockfd, SOCKERRNO);
+ "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
#endif
#ifdef TCP_KEEPINTVL
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL,
(void *)&optval, sizeof(optval)) < 0) {
CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPINTVL on fd "
- "%" FMT_SOCKET_T ": errno %d",
- sockfd, SOCKERRNO);
+ "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
}
#elif defined(TCP_KEEPALIVE_ABORT_THRESHOLD)
/* Solaris <11.4 style */
{
#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
static time_t time2epoch(int sec, int min, int hour,
int mday, int mon, int year)
{
- static const int month_days_cumulative [12] =
+ static const int month_days_cumulative[12] =
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
int leap_days = year - (mon <= 1);
leap_days = ((leap_days / 4) - (leap_days / 100) + (leap_days / 400)
state->retry_time = 1;
infof(state->data,
- "set timeouts for state %d; Total % " FMT_OFF_T ", retry %d maxtry %d",
+ "set timeouts for state %d; Total %" FMT_OFF_T ", retry %d maxtry %d",
(int)state->state, timeout_ms, state->retry_time, state->retry_max);
/* init RX time */
static CURLcode tftp_option_add(struct tftp_conn *state, size_t *csize,
char *buf, const char *option)
{
- if(( strlen(option) + *csize + 1) > (size_t)state->blksize)
+ if((strlen(option) + *csize + 1) > (size_t)state->blksize)
return CURLE_TFTP_ILLEGAL;
strcpy(buf, option);
*csize += strlen(option) + 1;
for(j = 0; j < default_len; j++) {
entry = rustls_default_crypto_provider_ciphersuites_get(j);
if(rustls_supported_ciphersuite_protocol_version(entry) ==
- RUSTLS_TLS_VERSION_TLSV1_3)
+ RUSTLS_TLS_VERSION_TLSV1_3)
continue;
/* No duplicates allowed (so selected cannot overflow) */
}
}
- if((fInCert || blob) && (data->set.ssl.cert_type) &&
- (!curl_strequal(data->set.ssl.cert_type, "P12"))) {
+ if((fInCert || blob) && data->set.ssl.cert_type &&
+ !curl_strequal(data->set.ssl.cert_type, "P12")) {
failf(data, "schannel: certificate format compatibility error "
" for %s",
blob ? "(memory blob)" : data->set.ssl.primary.clientcert);
return CURLE_NOT_BUILT_IN;
}
-#endif /* !CURL_DISABLE_WEBSOCKETS */
+#endif /* !CURL_DISABLE_WEBSOCKETS && !CURL_DISABLE_HTTP */
report "LWP is not available (LWP::UserAgent not found)";
exit 1;
}
- my $ua = new LWP::UserAgent(agent => "$0/$version");
+ my $ua = new LWP::UserAgent(agent => "$0/$version");
$ua->env_proxy();
$resp = $ua->mirror($url, $txt);
if($resp && $resp->code eq '304') {
elif git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
{
git ls-files | grep -E '\.(pl|pm)$'
- git grep -l -E '^#!/usr/bin/env perl'
+ git grep -l '^#!/usr/bin/env perl'
} | sort -u
else
# strip off the leading ./ to make the grep regexes work properly
# ECH command line args
def CombinationRepetitionUtil(chosen, arr, badarr, index,
- r, start, end):
+ r, start, end):
# Current combination is ready,
# print it
# with next (Note that i+1 is passed,
# but index is not changed)
CombinationRepetitionUtil(chosen, arr, badarr, index + 1,
- r, start, end)
+ r, start, end)
CombinationRepetitionUtil(chosen, arr, badarr, index,
- r, start + 1, end)
+ r, start + 1, end)
# The main function that prints all
# combinations of size r in arr[] of
n = len(arr) - 1
CombinationRepetition(arr, badarr, n, r)
-
-# This code is contributed by Vaibhav Kumar 12.
}
}
else {
- print STDERR "\nWarning: ftpserver.pl unknown parameter: $ARGV[0]\n";
+ print STDERR "\nWarning: ftpserver.pl unknown parameter: '$ARGV[0]'\n";
}
shift @ARGV;
}
my ($filename, $arrayref)=@_;
open(my $temp, ">", "$filename") || die "Failure writing file";
- binmode($temp,":raw"); # Cygwin fix by Kevin Roth
+ binmode($temp,":raw"); # Cygwin fix
for(@$arrayref) {
print $temp $_;
}
$verbose = 1;
}
else {
- print STDERR "\nWarning: http-server.pl unknown parameter: $ARGV[0]\n";
+ print STDERR "\nWarning: http-server.pl unknown parameter: '$ARGV[0]'\n";
}
shift @ARGV;
}
}
}
elsif($ARGV[0]) {
- print STDERR "\nWarning: http2-server.pl unknown parameter: $ARGV[0]\n";
+ print STDERR "\nWarning: http2-server.pl unknown parameter: '$ARGV[0]'\n";
}
shift @ARGV;
}
}
}
else {
- print STDERR "\nWarning: http3-server.pl unknown parameter: $ARGV[0]\n";
+ print STDERR "\nWarning: http3-server.pl unknown parameter: '$ARGV[0]'\n";
}
shift @ARGV;
}
$verbose = 1;
}
else {
- print STDERR "\nWarning: rtspserver.pl unknown parameter: $ARGV[0]\n";
+ print STDERR "\nWarning: rtspserver.pl unknown parameter: '$ARGV[0]'\n";
}
shift @ARGV;
}
$mtls = 1;
}
else {
- print STDERR "\nWarning: secureserver.pl unknown parameter: $ARGV[0]\n";
+ print STDERR "\nWarning: secureserver.pl unknown parameter: '$ARGV[0]'\n";
}
shift @ARGV;
}
}
}
else {
- print STDERR "\nWarning: sshserver.pl unknown parameter: $ARGV[0]\n";
+ print STDERR "\nWarning: sshserver.pl unknown parameter: '$ARGV[0]'\n";
}
shift @ARGV;
}
$verbose = 1;
}
else {
- print STDERR "\nWarning: tftpserver.pl unknown parameter: $ARGV[0]\n";
+ print STDERR "\nWarning: tftpserver.pl unknown parameter: '$ARGV[0]'\n";
}
shift @ARGV;
}