mirror of
https://github.com/curl/curl.git
synced 2026-07-24 09:37:25 +03:00
tidy-up: miscellaneous
- 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
This commit is contained in:
parent
a87383828e
commit
1b48c6148a
32 changed files with 62 additions and 71 deletions
|
|
@ -171,8 +171,7 @@ tcpkeepalive(struct Curl_cfilter *cf,
|
|||
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
|
||||
|
|
@ -187,22 +186,19 @@ tcpkeepalive(struct Curl_cfilter *cf,
|
|||
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
|
||||
|
|
@ -239,8 +235,7 @@ tcpkeepalive(struct Curl_cfilter *cf,
|
|||
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 */
|
||||
|
|
@ -249,8 +244,7 @@ tcpkeepalive(struct Curl_cfilter *cf,
|
|||
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 */
|
||||
|
|
@ -259,8 +253,7 @@ tcpkeepalive(struct Curl_cfilter *cf,
|
|||
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
|
||||
|
|
@ -269,8 +262,7 @@ tcpkeepalive(struct Curl_cfilter *cf,
|
|||
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 */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ enum assume {
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ static CURLcode tftp_set_timeouts(struct tftp_conn *state)
|
|||
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 */
|
||||
|
|
@ -381,7 +381,7 @@ static CURLcode tftp_parse_option_ack(struct tftp_conn *state,
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -494,7 +494,7 @@ add_ciphers:
|
|||
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) */
|
||||
|
|
|
|||
|
|
@ -566,8 +566,8 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf,
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
|
|||
2
lib/ws.c
2
lib/ws.c
|
|
@ -2016,4 +2016,4 @@ CURL_EXTERN CURLcode curl_ws_start_frame(CURL *curl,
|
|||
return CURLE_NOT_BUILT_IN;
|
||||
}
|
||||
|
||||
#endif /* !CURL_DISABLE_WEBSOCKETS */
|
||||
#endif /* !CURL_DISABLE_WEBSOCKETS && !CURL_DISABLE_HTTP */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue