r4408 - branches/2.0/varnish-cache/lib/libvarnish
tfheen at projects.linpro.no
tfheen at projects.linpro.no
Wed Dec 16 12:14:46 CET 2009
Author: tfheen
Date: 2009-12-16 12:14:46 +0100 (Wed, 16 Dec 2009)
New Revision: 4408
Modified:
branches/2.0/varnish-cache/lib/libvarnish/tcp.c
Log:
Merge r4384: Don't panic in TCP_linger() if the other end closed on us.
Fixes #547
Modified: branches/2.0/varnish-cache/lib/libvarnish/tcp.c
===================================================================
--- branches/2.0/varnish-cache/lib/libvarnish/tcp.c 2009-12-16 11:05:05 UTC (rev 4407)
+++ branches/2.0/varnish-cache/lib/libvarnish/tcp.c 2009-12-16 11:14:46 UTC (rev 4408)
@@ -239,8 +239,10 @@
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);
}
More information about the varnish-commit
mailing list