Browse Source

clean this up a bit

pull/34/head
jake 3 years ago
parent
commit
45f0cc35dd
  1. 16
      src/common/mainloop/interserver.rs

16
src/common/mainloop/interserver.rs

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

Loading…
Cancel
Save