Skip to content

Commit

Permalink
small net cleanup
Browse files Browse the repository at this point in the history
- add comment for disabling sigpipe
- add closing comment in compat.h
- remove redundant check in net.h
  • Loading branch information
Philip Kaufmann committed Aug 8, 2014
1 parent 8833acc commit efd6b87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/compat.h
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -59,4 +59,4 @@ typedef u_int SOCKET;
#define SOCKET_ERROR -1
#endif

#endif
#endif // _BITCOIN_COMPAT_H
7 changes: 3 additions & 4 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,11 @@ class CNode

~CNode()
{
if (hSocket != INVALID_SOCKET)
{
CloseSocket(hSocket);
}
CloseSocket(hSocket);

if (pfilter)
delete pfilter;

GetNodeSignals().FinalizeNode(GetId());
}

Expand Down
1 change: 1 addition & 0 deletions src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit efd6b87

Please sign in to comment.