jake 4 years ago
committed by andy
parent
commit
eb947cc4d5
  1. 6
      src/common/mainloop/interserver.rs

6
src/common/mainloop/interserver.rs

@ -156,14 +156,14 @@ where
match output_loop_receiver.recv().await { match output_loop_receiver.recv().await {
Ok(msg) => { Ok(msg) => {
let payload = serde_json::to_string(&msg); let payload = serde_json::to_string(&msg);
if let Ok(payload2) = payload {
let len_bytes = u32::to_le_bytes(payload2.len() as u32);
if let Ok(payload) = payload {
let len_bytes = u32::to_le_bytes(payload.len() as u32);
if let Err(err) = socket.write_all(&len_bytes).await { if let Err(err) = socket.write_all(&len_bytes).await {
warn!("interserver send failed: {:?}", err); warn!("interserver send failed: {:?}", err);
break; break;
} }
if let Err(err) = socket.write_all(&payload2.as_bytes()).await {
if let Err(err) = socket.write_all(&payload.as_bytes()).await {
warn!("intserserver send failed: {:?}", err); warn!("intserserver send failed: {:?}", err);
break; break;
} }

Loading…
Cancel
Save