small net cleanup #4636

pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:net_cleanup_closesocket changing 3 files +6 −6
  1. Diapolo commented at 11:42 AM on August 5, 2014: none
    • add comment for disabling sigpipe
    • add closing comment in compat.h
    • remove redundant check in net.h
  2. laanwj commented at 1:22 PM on August 6, 2014: member

    Untested ACK

  3. 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

  4. laanwj commented at 2:43 PM on August 6, 2014: member

    Voila #4641

  5. laanwj added the label Improvement on Aug 6, 2014
  6. Diapolo commented at 8:27 AM on August 7, 2014: none

    @laanwj What do you suggest so this can be megerd? Understand my intention do make identical code look identical? Just want to get this in...

  7. 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.

  8. 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 ;).

  9. 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

  10. jgarzik commented at 5:53 PM on August 7, 2014: contributor

    +1 @laanwj

  11. Diapolo renamed this:
    small cleanup - use of CloseSocket()
    small net cleanup
    on Aug 8, 2014
  12. small net cleanup
    - add comment for disabling sigpipe
    - add closing comment in compat.h
    - remove redundant check in net.h
    efd6b87811
  13. Diapolo commented at 5:41 AM on August 8, 2014: none

    Done!

  14. 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.

  15. laanwj merged this on Aug 8, 2014
  16. laanwj closed this on Aug 8, 2014

  17. laanwj referenced this in commit 3181986d7e on Aug 8, 2014
  18. Diapolo deleted the branch on Aug 8, 2014
  19. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me