Commit bc7b2d50 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Don't panic in TCP_linger() if the other end closed on us.

Fixes #547



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4384 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 6dcf13ca
......@@ -240,8 +240,10 @@ void
TCP_linger(int sock, int linger)
{
struct linger lin;
int i;
memset(&lin, 0, sizeof lin);
lin.l_onoff = linger;
AZ(setsockopt(sock, SOL_SOCKET, SO_LINGER, &lin, sizeof lin));
i = setsockopt(sock, SOL_SOCKET, SO_LINGER, &lin, sizeof lin);
assert(i == 0 || errno == EBADF);
}
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