8000 net, refactor: Privatise CNode send queue by dergoegge · Pull Request #27407 · bitcoin/bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

net, refactor: Privatise CNode send queue #27407

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

Closed

Conversation

dergoegge
Copy link
Member

The send queue members on CNode should not be part of the public interface. This PR makes all of them private and creates a clear interface for the send queue.

The interface after this PR consists of:

  • CNode::PushMessage for appending a message onto the send queue
  • CNode::SocketSendData for pushing as many messages from the send queue as possible onto the wire
  • CNode::IsSendQueueEmpty for checking if the send queue is empty
  • (CNode::TestOnlyClearSendQueue a test-only utility for clearing the send queue)

There are no `CConnman` members used in `SocketSendData`, it should
therefore be a method in `CNode` instead.
-BEGIN VERIFY SCRIPT-
ren() { sed -i "s:\<$1\>:$2:g" $(git grep -l "\<$1\>" ./src ./test); }

ren cs_vSend    m_send_queue_mutex
ren vSendMsg    m_send_queue
ren nSendBytes  m_send_bytes
ren nSendOffset m_send_offset
ren nSendSize   m_total_send_size

-END VERIFY SCRIPT-
@DrahtBot
Copy link
Contributor
DrahtBot commented Apr 3, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #28196 (BIP324 connection support by sipa)
  • #28165 (net: transport abstraction by sipa)
  • #27981 (Fix potential network stalling bug by sipa)
  • #26621 (refactor: Continue moving application data from CNode to Peer by dergoegge)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0