aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-08-08 09:30:03 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-08-08 09:30:19 +0200
commit3181986d7e6466592c6b3d57c22858e2f44372bb (patch)
tree997b0568d7315ae0b911c55ccb18aaf156c338c6
parent2260c99f388a1305ad40345631094fe629f87cff (diff)
parentefd6b87811351cde592ac48247190e682ad02aea (diff)
Merge pull request #4636
efd6b87 small net cleanup (Philip Kaufmann)
-rw-r--r--src/compat.h4
-rw-r--r--src/net.h7
-rw-r--r--src/netbase.cpp1
3 files changed, 6 insertions, 6 deletions
diff --git a/src/compat.h b/src/compat.h
index 1b3a60d11b..52c7817130 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
-// Copyright (c) 2009-2013 The Bitcoin developers
+// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -59,4 +59,4 @@ typedef u_int SOCKET;
#define SOCKET_ERROR -1
#endif
-#endif
+#endif // _BITCOIN_COMPAT_H
diff --git a/src/net.h b/src/net.h
index 2d9325abf9..a8795a4760 100644
--- a/src/net.h
+++ b/src/net.h
@@ -356,12 +356,11 @@ public:
~CNode()
{
- if (hSocket != INVALID_SOCKET)
- {
- CloseSocket(hSocket);
- }
+ CloseSocket(hSocket);
+
if (pfilter)
delete pfilter;
+
GetNodeSignals().FinalizeNode(GetId());
}
diff --git a/src/netbase.cpp b/src/netbase.cpp
index af6d11f0e2..1031e7e38a 100644
--- a/src/netbase.cpp
+++ b/src/netbase.cpp
@@ -334,6 +334,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe
#ifdef SO_NOSIGPIPE
int set = 1;
+ // Different way of disabling SIGPIPE on BSD
setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int));
#endif