fix(router): handle client empty message (#1965)

* fix(router): handle client empty message

* style(fmt): rustfmt
This commit is contained in:
Aram Drevekenin 2022-11-23 10:10:42 +01:00 committed by GitHub
parent 11b0210de5
commit b0218f4d50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -795,15 +795,15 @@ pub(crate) fn route_thread_main(
}
},
None => {
log::error!("Received empty message from client, logging client out.");
let _ = os_input.send_to_client(
client_id,
ServerToClientMsg::Exit(ExitReason::Error(
"Received empty message".to_string(),
)),
);
return Err(anyhow!("received empty message from client"))
.with_context(err_context);
let _ = to_server.send(ServerInstruction::RemoveClient(client_id));
break 'route_loop;
},
}
}