mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
net: abstract sending side of transport serialization further
This makes the sending side of P2P transports mirror the receiver side: caller provides message (consisting of type and payload) to be sent, and then asks what bytes must be sent. Once the message has been fully sent, a new message can be provided. This removes the assumption that P2P serialization of messages follows a strict structure of header (a function of type and payload), followed by (unmodified) payload, and instead lets transports decide the structure themselves. It also removes the assumption that a message must always be sent at once, or that no bytes are even sent on the wire when there is no message. This opens the door for supporting traffic shaping mechanisms in the future.
This commit is contained in:
@@ -67,7 +67,7 @@ FUZZ_TARGET(process_messages, .init = initialize_process_messages)
|
||||
|
||||
CNode& random_node = *PickValue(fuzzed_data_provider, peers);
|
||||
|
||||
(void)connman.ReceiveMsgFrom(random_node, net_msg);
|
||||
(void)connman.ReceiveMsgFrom(random_node, std::move(net_msg));
|
||||
random_node.fPauseSend = false;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user