Commit 81254091 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune Committed by Martin Blix Grydeland

vca: Give sock_opt constant arguments better names

And while at it, update the SO_LINGER explanation to match reality.

Refs 7eba9460
parent 04ae469a
...@@ -117,11 +117,11 @@ static const int n_sock_opts = sizeof sock_opts / sizeof sock_opts[0]; ...@@ -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 * 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, * as absolutely possible, so we set them LINGER disabled, so that even if
* so that even if there are outstanding write data on the socket, a close(2) * there are outstanding write data on the socket, a close(2) will return
* will return immediately. * immediately.
*/ */
static const struct linger linger = { static const struct linger disable_so_linger = {
.l_onoff = 0, .l_onoff = 0,
}; };
...@@ -130,12 +130,12 @@ static const struct linger linger = { ...@@ -130,12 +130,12 @@ static const struct linger linger = {
* hung up on connections returning from waitinglists * 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. /* 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; static unsigned need_test;
...@@ -196,13 +196,13 @@ vca_sock_opt_init(void) ...@@ -196,13 +196,13 @@ vca_sock_opt_init(void)
} \ } \
} while (0) } while (0)
SET_VAL(SO_LINGER, so, lg, linger); SET_VAL(SO_LINGER, so, lg, disable_so_linger);
SET_VAL(SO_KEEPALIVE, so, i, so_keepalive); SET_VAL(SO_KEEPALIVE, so, i, enable_so_keepalive);
NEW_VAL(SO_SNDTIMEO, so, tv, NEW_VAL(SO_SNDTIMEO, so, tv,
VTIM_timeval(cache_param->idle_send_timeout)); VTIM_timeval(cache_param->idle_send_timeout));
NEW_VAL(SO_RCVTIMEO, so, tv, NEW_VAL(SO_RCVTIMEO, so, tv,
VTIM_timeval(cache_param->timeout_idle)); 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 #ifdef HAVE_TCP_KEEP
NEW_VAL(TCP_KEEPIDLE, so, i, NEW_VAL(TCP_KEEPIDLE, so, i,
(int)cache_param->tcp_keepalive_time); (int)cache_param->tcp_keepalive_time);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment