[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-commit
Subject:    r4408 - branches/2.0/varnish-cache/lib/libvarnish
From:       tfheen () projects ! linpro ! no (tfheen at projects ! linpro ! no)
Date:       2009-12-16 11:14:46
Message-ID: 20091216111446.CF09D1F7530 () projects ! linpro ! no
[Download RAW message or body]

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);
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic