Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: switch to libevent for node socket handling #11227

Closed
wants to merge 23 commits into from

Commits on Sep 20, 2017

  1. Copy the full SHA
    ced8190 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    38a58fd View commit details
    Browse the repository at this point in the history
  3. net: merge duplicate checks

    theuni committed Sep 20, 2017
    Copy the full SHA
    4aeb685 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    03e73a7 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    813de90 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    d44e02b View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    c8efe8c View commit details
    Browse the repository at this point in the history
  8. net: when de-activating p2p, set nodes to be disconnected rather than…

    … closing the socket immediately
    
    Messing with the socket from a non-network thread adds unnecessary complexity.
    theuni committed Sep 20, 2017
    Copy the full SHA
    375a916 View commit details
    Browse the repository at this point in the history
  9. net: Add a Disconnect function for nodes

    For now, this just sets fDisconnect like before. But a function will be
    necessary later.
    theuni committed Sep 20, 2017
    Copy the full SHA
    72259b1 View commit details
    Browse the repository at this point in the history
  10. scripted-diff: Call Disconnect rather than setting fDisconnect directly

    -BEGIN VERIFY SCRIPT-
    sed -i 's/fDisconnect = true/Disconnect()/' src/net.cpp src/net_processing.cpp
    -END VERIFY SCRIPT-
    theuni committed Sep 20, 2017
    Copy the full SHA
    df02ec6 View commit details
    Browse the repository at this point in the history
  11. net: add an EnableReceive function so that the message handler can tr…

    …igger it
    
    for now this just disables fPauseRecv, but it will need to be a function later.
    theuni committed Sep 20, 2017
    Copy the full SHA
    7bf4b56 View commit details
    Browse the repository at this point in the history
  12. net: get rid of optimistic send and the socket lock

    The socket lock only existed because it was possible to trigger an immediate
    disconnect via threads other than the socket handler.
    
    The optimistic send was the last offender.
    theuni committed Sep 20, 2017
    Copy the full SHA
    9b5b0a0 View commit details
    Browse the repository at this point in the history
  13. Copy the full SHA
    6eaae10 View commit details
    Browse the repository at this point in the history
  14. Copy the full SHA
    a9f4dbd View commit details
    Browse the repository at this point in the history
  15. Copy the full SHA
    87aaa48 View commit details
    Browse the repository at this point in the history
  16. Copy the full SHA
    17405ed View commit details
    Browse the repository at this point in the history
  17. net: pass the socket/whitelist args directly to AcceptConnection

    Subsequent changes will turn AcceptConnection into a callback where the socket
    is one of the supplied params.
    theuni committed Sep 20, 2017
    Copy the full SHA
    f5ffe41 View commit details
    Browse the repository at this point in the history
  18. net: add an event handler for future read/write callbacks

    For now this just handles read/write/error/timeout conditions for each node
    serially, but OnEvents will soon be invoked as a callback when socket status
    changes.
    theuni committed Sep 20, 2017
    Copy the full SHA
    53d6bdf View commit details
    Browse the repository at this point in the history
  19. Copy the full SHA
    de8b234 View commit details
    Browse the repository at this point in the history
  20. net: Only close the socket in once place

    By only allowing the socket to be closed and the handle to be invalidated in
    one place, it becomes much easier to reason about the status at any given time.
    theuni committed Sep 20, 2017
    Copy the full SHA
    c7f9e60 View commit details
    Browse the repository at this point in the history
  21. Copy the full SHA
    863d499 View commit details
    Browse the repository at this point in the history
  22. Net: handle all new connections on the socket handler thread

    This ensures that outgoing connections don't race with event teardown at
    shutdown.
    theuni committed Sep 20, 2017
    Copy the full SHA
    f3fc360 View commit details
    Browse the repository at this point in the history
  23. Copy the full SHA
    77cee16 View commit details
    Browse the repository at this point in the history