[6.0] 81254091d vca: Give sock_opt constant arguments better names
Martin Blix Grydeland
martin at varnish-software.com
Fri Nov 19 14:58:11 UTC 2021
commit 81254091d7d95756d935ccffd5f8aa5baba1ba21
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Mon Sep 27 13:17:55 2021 +0200
vca: Give sock_opt constant arguments better names
And while at it, update the SO_LINGER explanation to match reality.
Refs 7eba94605b9f
diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index c141c9189..94d32b1f2 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -117,11 +117,11 @@ static const int n_sock_opts = sizeof sock_opts / sizeof sock_opts[0];
/*--------------------------------------------------------------------
* We want to get out of any kind of trouble-hit TCP connections as fast
- * as absolutely possible, so we set them LINGER enabled with zero timeout,
- * so that even if there are outstanding write data on the socket, a close(2)
- * will return immediately.
+ * as absolutely possible, so we set them LINGER disabled, so that even if
+ * there are outstanding write data on the socket, a close(2) will return
+ * immediately.
*/
-static const struct linger linger = {
+static const struct linger disable_so_linger = {
.l_onoff = 0,
};
@@ -130,12 +130,12 @@ static const struct linger linger = {
* hung up on connections returning from waitinglists
*/
-static const unsigned so_keepalive = 1;
+static const unsigned enable_so_keepalive = 1;
/* We disable Nagle's algorithm in favor of low latency setups.
*/
-static const unsigned tcp_nodelay = 1;
+static const unsigned enable_tcp_nodelay = 1;
static unsigned need_test;
@@ -196,13 +196,13 @@ vca_sock_opt_init(void)
} \
} while (0)
- SET_VAL(SO_LINGER, so, lg, linger);
- SET_VAL(SO_KEEPALIVE, so, i, so_keepalive);
+ SET_VAL(SO_LINGER, so, lg, disable_so_linger);
+ SET_VAL(SO_KEEPALIVE, so, i, enable_so_keepalive);
NEW_VAL(SO_SNDTIMEO, so, tv,
VTIM_timeval(cache_param->idle_send_timeout));
NEW_VAL(SO_RCVTIMEO, so, tv,
VTIM_timeval(cache_param->timeout_idle));
- SET_VAL(TCP_NODELAY, so, i, tcp_nodelay);
+ SET_VAL(TCP_NODELAY, so, i, enable_tcp_nodelay);
#ifdef HAVE_TCP_KEEP
NEW_VAL(TCP_KEEPIDLE, so, i,
(int)cache_param->tcp_keepalive_time);
More information about the varnish-commit
mailing list