]> granicus.if.org Git - pdns/commitdiff
close very rare issue with tcp/ip close reporting ECONNRESET, reported by Andrei...
authorBert Hubert <bert.hubert@netherlabs.nl>
Sat, 15 Nov 2008 21:34:36 +0000 (21:34 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sat, 15 Nov 2008 21:34:36 +0000 (21:34 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1280 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/unix_utility.cc

index 54e14848102666fa37558560207a0d772ab3b310..85e086a129f56ab96b65886fd1d8fe08bcd275fd 100644 (file)
@@ -41,7 +41,9 @@ using namespace std;
 int Utility::closesocket( Utility::sock_t socket )
 {
   int ret=::close(socket);
-  if(ret < 0)
+  if(ret < 0 && errno == ECONNRESET) // see ticket 192, odd BSD behaviour
+    return 0;
+  if(ret < 0) 
     throw AhuException("Error closing socket: "+stringerror());
   return ret;
 }