tidy-up: one more round of formatting nits

Closes #19835
This commit is contained in:
Viktor Szakats 2025-11-29 23:11:52 +01:00
parent 7a1e99eefa
commit 0476e4fc65
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
149 changed files with 1381 additions and 1376 deletions

View file

@ -73,7 +73,7 @@
#include "../curlx/warnless.h"
#define QUIC_MAX_STREAMS (256 * 1024)
#define QUIC_MAX_STREAMS (256 * 1024)
#define QUIC_HANDSHAKE_TIMEOUT (10 * NGTCP2_SECONDS)
/* A stream window is the maximum amount we need to buffer for
@ -91,12 +91,11 @@
* spares. Memory consumption goes down when streams run empty,
* have a large upload done, etc. */
#define H3_STREAM_POOL_SPARES \
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE ) / 2
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) / 2
/* Receive and Send max number of chunks just follows from the
* chunk size and window size */
#define H3_STREAM_SEND_CHUNKS \
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
/*
* Store ngtcp2 version info in this buffer.
@ -959,7 +958,7 @@ static CURLcode cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf,
CF_DATA_SAVE(save, cf, data);
c_exhaust = want_send && (!ngtcp2_conn_get_cwnd_left(ctx->qconn) ||
!ngtcp2_conn_get_max_data_left(ctx->qconn));
!ngtcp2_conn_get_max_data_left(ctx->qconn));
s_exhaust = want_send && stream && stream->id >= 0 &&
stream->quic_flow_blocked;
want_recv = (want_recv || c_exhaust || s_exhaust);
@ -2513,7 +2512,7 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf,
CURLcode result;
const struct Curl_sockaddr_ex *sockaddr = NULL;
int qfd;
static const struct alpn_spec ALPN_SPEC_H3 = {{ "h3", "h3-29" }, 2};
static const struct alpn_spec ALPN_SPEC_H3 = { { "h3", "h3-29" }, 2 };
DEBUGASSERT(ctx->initialized);
ctx->dcid.datalen = NGTCP2_MAX_CIDLEN;

View file

@ -70,13 +70,13 @@
* spares. Memory consumption goes down when streams run empty,
* have a large upload done, etc. */
#define H3_STREAM_POOL_SPARES \
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE ) / 2
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) / 2
/* Receive and Send max number of chunks just follows from the
* chunk size and window size */
#define H3_STREAM_RECV_CHUNKS \
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
#define H3_STREAM_SEND_CHUNKS \
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
#if defined(OPENSSL_IS_BORINGSSL) || defined(OPENSSL_IS_AWSLC)
typedef uint32_t sslerr_t;
@ -87,8 +87,7 @@ typedef unsigned long sslerr_t;
/* How to access `call_data` from a cf_osslq filter */
#undef CF_CTX_CALL_DATA
#define CF_CTX_CALL_DATA(cf) \
((struct cf_osslq_ctx *)(cf)->ctx)->call_data
#define CF_CTX_CALL_DATA(cf) ((struct cf_osslq_ctx *)(cf)->ctx)->call_data
static CURLcode cf_progress_ingress(struct Curl_cfilter *cf,
struct Curl_easy *data);
@ -954,7 +953,7 @@ static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t stream_id,
(void)conn;
if(stream && stream->s.ssl) {
SSL_STREAM_RESET_ARGS args = {0};
SSL_STREAM_RESET_ARGS args = { 0 };
args.quic_error_code = app_error_code;
rv = !SSL_stream_reset(stream->s.ssl, &args, sizeof(args));
CURL_TRC_CF(data, cf, "[%" PRId64 "] reset -> %d", stream_id, rv);

View file

@ -65,11 +65,11 @@
* stream buffer to not keep spares. Memory consumption goes down when streams
* run empty, have a large upload done, etc. */
#define H3_STREAM_POOL_SPARES \
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE ) / 2
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) / 2
/* Receive and Send max number of chunks just follows from the
* chunk size and window size */
#define H3_STREAM_RECV_CHUNKS \
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
/*
* Store quiche version info in this buffer.
@ -1228,7 +1228,7 @@ static CURLcode cf_quiche_ctx_open(struct Curl_cfilter *cf,
int rv;
CURLcode result;
const struct Curl_sockaddr_ex *sockaddr;
static const struct alpn_spec ALPN_SPEC_H3 = {{ "h3" }, 1};
static const struct alpn_spec ALPN_SPEC_H3 = { { "h3" }, 1 };
DEBUGASSERT(ctx->q.sockfd != CURL_SOCKET_BAD);
DEBUGASSERT(ctx->initialized);

View file

@ -178,12 +178,12 @@ CURLcode Curl_vquic_tls_verify_peer(struct curl_tls_ctx *ctx,
if(!cert)
result = CURLE_OUT_OF_MEMORY;
else if(peer->sni &&
(wolfSSL_X509_check_host(cert, peer->sni, strlen(peer->sni), 0, NULL)
== WOLFSSL_FAILURE))
(wolfSSL_X509_check_host(cert, peer->sni, strlen(peer->sni), 0,
NULL) == WOLFSSL_FAILURE))
result = CURLE_PEER_FAILED_VERIFICATION;
else if(!peer->sni &&
(wolfSSL_X509_check_ip_asc(cert, peer->hostname, 0)
== WOLFSSL_FAILURE))
(wolfSSL_X509_check_ip_asc(cert, peer->hostname,
0) == WOLFSSL_FAILURE))
result = CURLE_PEER_FAILED_VERIFICATION;
wolfSSL_X509_free(cert);
}

View file

@ -124,7 +124,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf,
CURLcode result = CURLE_OK;
#ifdef HAVE_SENDMSG
struct iovec msg_iov;
struct msghdr msg = {0};
struct msghdr msg = { 0 };
ssize_t rv;
#if defined(__linux__) && defined(UDP_SEGMENT)
uint8_t msg_ctrl[32];
@ -153,8 +153,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf,
}
#endif
while((rv = sendmsg(qctx->sockfd, &msg, 0)) == -1 &&
SOCKERRNO == SOCKEINTR)
while((rv = sendmsg(qctx->sockfd, &msg, 0)) == -1 && SOCKERRNO == SOCKEINTR)
;
if(!curlx_sztouz(rv, psent)) {
@ -516,7 +515,7 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf,
}
curlx_strerror(SOCKERRNO, errstr, sizeof(errstr));
failf(data, "QUIC: recvmsg() unexpectedly returned %zd (errno=%d; %s)",
rc, SOCKERRNO, errstr);
rc, SOCKERRNO, errstr);
result = CURLE_RECV_ERROR;
goto out;
}
@ -581,7 +580,7 @@ static CURLcode recvfrom_packets(struct Curl_cfilter *cf,
}
curlx_strerror(SOCKERRNO, errstr, sizeof(errstr));
failf(data, "QUIC: recvfrom() unexpectedly returned %zd (errno=%d; %s)",
rv, SOCKERRNO, errstr);
rv, SOCKERRNO, errstr);
result = CURLE_RECV_ERROR;
goto out;
}

View file

@ -29,7 +29,7 @@
#ifdef USE_HTTP3
#define MAX_PKT_BURST 10
#define MAX_PKT_BURST 10
#define MAX_UDP_PAYLOAD_SIZE 1452
struct cf_quic_ctx {