Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion consensus/src/ordered_broadcast/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ impl<
node_sender
.send(
Recipients::Some(validators.iter().cloned().collect()),
node.encode(),
node.encode().freeze(),
self.priority_proposals,
)
.await
Expand Down
2 changes: 1 addition & 1 deletion examples/sync/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ where
outgoing = response_receiver.next() => {
if let Some(response) = outgoing {
// We have a response to send to the client.
let response_data = response.encode();
let response_data = response.encode().freeze();
if let Err(err) = send_frame(&mut sink, response_data, MAX_MESSAGE_SIZE).await {
info!(client_addr = %client_addr, ?err, "send failed (client likely disconnected)");
state.error_counter.inc();
Expand Down
2 changes: 1 addition & 1 deletion examples/sync/src/net/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async fn run_loop<E, Si, St, M>(
Some(Request { request, response_tx }) => {
let request_id = request.request_id();
pending_requests.insert(request_id, response_tx);
let data = request.encode();
let data = request.encode().freeze();
if let Err(e) = send_frame(&mut sink, data, MAX_MESSAGE_SIZE).await {
if let Some(sender) = pending_requests.remove(&request_id) {
let _ = sender.send(Err(Error::Network(e)));
Expand Down
2 changes: 1 addition & 1 deletion p2p/src/utils/mux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ impl<'a, S: Sender> CheckedSender for CheckedGlobalSender<'a, S> {
) -> Result<Vec<Self::PublicKey>, Self::Error> {
let subchannel = UInt(self.subchannel.expect("subchannel not set"));
self.inner
.send(subchannel.encode().chain(message), priority)
.send(subchannel.encode().freeze().chain(message), priority)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't really cause any issues but better safe than sorry

.await
}
}
Expand Down
3 changes: 1 addition & 2 deletions runtime/src/network/iouring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ impl Sink {

impl crate::Sink for Sink {
async fn send(&mut self, mut msg: impl Buf + Send) -> Result<(), crate::Error> {
// For now, collect the message into a stable buffer. In the future,
// we could optimize this by using writev w/ a keepalive for the iovecs.
// TODO(#2705): Use writev to avoid this copy.
let mut msg: StableBuf = {
let buf = msg.copy_to_bytes(msg.remaining());
BytesMut::from(buf).into()
Expand Down
Loading