From 8a2a91f11aa58d54577a042def2a87788c0d9809 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 7 Aug 2006 09:21:54 +0000 Subject: [PATCH] Set SO_SNDTIMEO to 120 seconds git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@709 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_acceptor.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/varnish-cache/bin/varnishd/cache_acceptor.c b/varnish-cache/bin/varnishd/cache_acceptor.c index 8dddf4dc..1b7b3a85 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor.c +++ b/varnish-cache/bin/varnishd/cache_acceptor.c @@ -61,6 +61,15 @@ vca_accept_sess(int fd) linger.l_linger = 0; AZ(setsockopt(sp->fd, SOL_SOCKET, SO_LINGER, &linger, sizeof linger)); #endif +#ifdef SO_SNDTIMEO + { + struct timeval tv; + + tv.tv_sec = 120; + tv.tv_usec = 0; + AZ(setsockopt(sp->fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof tv)); + } +#endif TCP_name(addr, l, sp->addr, sizeof sp->addr, sp->port, sizeof sp->port); VSL(SLT_SessionOpen, sp->fd, "%s %s", sp->addr, sp->port); -- 2.39.5