Unverified Commit 258471a3 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune Committed by Nils Goroll

vca: Remove the tcp_opt::iponly field

It is a 1:1 mapping with IPPROTO_TCP, so TCP_NODELAY was moved down to
be with the other IPPROTO_TCP options.

Conflicts:
	bin/varnishd/cache/cache_acceptor.c
parent d084467a
......@@ -87,26 +87,23 @@ static struct tcp_opt {
socklen_t sz;
void *ptr;
int need;
int iponly;
} tcp_opts[] = {
#define TCPO(lvl, nam, sz, ip) { lvl, nam, #nam, sizeof(sz), 0, 0, ip},
TCPO(SOL_SOCKET, SO_LINGER, struct linger, 0)
TCPO(SOL_SOCKET, SO_KEEPALIVE, int, 0)
TCPO(IPPROTO_TCP, TCP_NODELAY, int, 1)
#define TCPO(lvl, nam, typ) { lvl, nam, #nam, sizeof(typ), NULL, 0 },
TCPO(SOL_SOCKET, SO_LINGER, struct linger)
TCPO(SOL_SOCKET, SO_KEEPALIVE, int)
#ifdef SO_SNDTIMEO_WORKS
TCPO(SOL_SOCKET, SO_SNDTIMEO, struct timeval, 0)
TCPO(SOL_SOCKET, SO_SNDTIMEO, struct timeval)
#endif
#ifdef SO_RCVTIMEO_WORKS
TCPO(SOL_SOCKET, SO_RCVTIMEO, struct timeval, 0)
TCPO(SOL_SOCKET, SO_RCVTIMEO, struct timeval)
#endif
TCPO(IPPROTO_TCP, TCP_NODELAY, int)
#ifdef HAVE_TCP_KEEP
TCPO(IPPROTO_TCP, TCP_KEEPIDLE, int, 1)
TCPO(IPPROTO_TCP, TCP_KEEPCNT, int, 1)
TCPO(IPPROTO_TCP, TCP_KEEPINTVL, int, 1)
TCPO(IPPROTO_TCP, TCP_KEEPIDLE, int)
TCPO(IPPROTO_TCP, TCP_KEEPCNT, int)
TCPO(IPPROTO_TCP, TCP_KEEPINTVL, int)
#endif
#undef TCPO
......@@ -229,7 +226,7 @@ vca_tcp_opt_test(const int sock, const unsigned uds)
for (n = 0; n < n_tcp_opts; n++) {
to = &tcp_opts[n];
if (to->iponly && uds)
if (to->level == IPPROTO_TCP && uds)
continue;
to->need = 1;
ptr = calloc(1, to->sz);
......@@ -252,7 +249,7 @@ vca_tcp_opt_set(const int sock, const unsigned uds, const int force)
for (n = 0; n < n_tcp_opts; n++) {
to = &tcp_opts[n];
if (to->iponly && uds)
if (to->level == IPPROTO_TCP && uds)
continue;
if (to->need || force) {
VTCP_Assert(setsockopt(sock,
......
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