- add comment for disabling sigpipe
- add closing comment in compat.h
- remove redundant check in net.h
small net cleanup #4636
pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:net_cleanup_closesocket changing 3 files +6 −6-
Diapolo commented at 11:42 AM on August 5, 2014: none
-
laanwj commented at 1:22 PM on August 6, 2014: member
Untested ACK
-
Diapolo commented at 2:34 PM on August 6, 2014: none
@jgarzik Is it silly to at least make identical code look identical? Perhaps look at our project not at others :-/.
https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp#L1642
- laanwj added the label Improvement on Aug 6, 2014
-
laanwj commented at 10:06 AM on August 7, 2014: member
@diapolo if you want to make easily mergable pulls, my suggestion would be to try to touch as few lines as possible to accomplish what you want. Also try to fix an open issue, or at least an problem. Not just your gut feeling on how the source code should look at a superficial level.
I'm not sure about some of the logging changes
- LogPrint("net", "disconnecting peer=%d\n", id); CloseSocket(hSocket); + LogPrint("net", "disconnecting peer=%d\n", id);Why? And it now says 'disconnecting' after the peer has been disconnected.
-
Diapolo commented at 10:15 AM on August 7, 2014: none
Why? Because of consistency reasons... indeed the message is now wrong, but I'm going to update it. If such things are that controversial, you are always free to close my pulls, perhaps I'm learning that these don't matter enough ;).
-
laanwj commented at 10:39 AM on August 7, 2014: member
IMO the worthwhile changes here are:
src/compat.h-// Copyright (c) 2009-2013 The Bitcoin developers +// Copyright (c) 2009-2014 The Bitcoin developers -#endif +#endif // _BITCOIN_COMPAT_H- File was updated this year
- Closing comment on #endif is remotely useful
src/net.h- if (hSocket != INVALID_SOCKET) - { - CloseSocket(hSocket); - } + CloseSocket(hSocket);- Check is redundant as it is already done in
CloseSocket
src/netbase.cpp+ // Different way of disabling SIGPIPE on BSD- This comment adds non-obvious information
Could do without: the logging changes, the whitespace changes, and the variable rename
- Diapolo renamed this:
small cleanup - use of CloseSocket()
small net cleanup
on Aug 8, 2014 -
efd6b87811
small net cleanup
- add comment for disabling sigpipe - add closing comment in compat.h - remove redundant check in net.h
-
Diapolo commented at 5:41 AM on August 8, 2014: none
Done!
-
BitcoinPullTester commented at 6:05 AM on August 8, 2014: none
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4636_efd6b87811351cde592ac48247190e682ad02aea/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
- laanwj merged this on Aug 8, 2014
- laanwj closed this on Aug 8, 2014
- laanwj referenced this in commit 3181986d7e on Aug 8, 2014
- Diapolo deleted the branch on Aug 8, 2014
- DrahtBot locked this on Sep 8, 2021