From 68f2a6d908cec726ad557fdc5bebebc5bed4de9b Mon Sep 17 00:00:00 2001 From: Alexander Schlindwein Date: Mon, 27 Mar 2023 22:42:08 +0200 Subject: [PATCH] Use write_all in IPC transport (#648) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tomasz Drwięga --- src/transports/ipc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transports/ipc.rs b/src/transports/ipc.rs index 866cd13f..a7abf1a2 100644 --- a/src/transports/ipc.rs +++ b/src/transports/ipc.rs @@ -193,7 +193,7 @@ async fn run_server(unix_stream: UnixStream, messages_rx: UnboundedReceiverStrea } let bytes = helpers::to_string(&rpc::Request::Single(rpc_call)).into_bytes(); - if let Err(err) = socket_writer.write(&bytes).await { + if let Err(err) = socket_writer.write_all(&bytes).await { pending_response_txs.remove(&request_id); log::error!("IPC write error: {:?}", err); } @@ -213,7 +213,7 @@ async fn run_server(unix_stream: UnixStream, messages_rx: UnboundedReceiverStrea let bytes = helpers::to_string(&rpc::Request::Batch(rpc_calls)).into_bytes(); - if let Err(err) = socket_writer.write(&bytes).await { + if let Err(err) = socket_writer.write_all(&bytes).await { log::error!("IPC write error: {:?}", err); for request_id in request_ids { pending_response_txs.remove(&request_id);