mirror of
https://github.com/ratspeak/rsLXMF
synced 2026-11-22 23:10:35 +00:00
lxmd: send no stats reply when it is not a propagation node
This commit is contained in:
1 parent
d3ad54a457
commit
b6db122563
2 files changed
+3
-6
No files matched your search
@@ -53,7 +53,7 @@ use lxmf_tools::lxmd_cli::{
|
||||
};
|
||||
use lxmf_tools::lxmd_control::{
|
||||
CONTROL_APP_NAME, ControlCommandKind, ControlResponse, decode_control_response,
|
||||
encode_control_success, encode_nil_response, encode_peer_error, encode_router_control_stats,
|
||||
encode_control_success, encode_peer_error, encode_router_control_stats,
|
||||
exit_for_control_response, format_remote_status, print_control_link_error, query_control,
|
||||
resolve_remote_identity_hash,
|
||||
};
|
||||
@@ -2452,7 +2452,8 @@ impl LxmdRunner {
|
||||
|
||||
if path_hash == stats_path_hash {
|
||||
tracing::info!("control: handling stats request");
|
||||
Some(snapshot.stats_response.unwrap_or_else(encode_nil_response))
|
||||
// compile_stats returns None off a propagation node: no response.
|
||||
snapshot.stats_response
|
||||
} else if path_hash == sync_path_hash {
|
||||
tracing::info!("control: handling peer sync request");
|
||||
if data.len() != 16 {
|
||||
|
||||
@@ -147,10 +147,6 @@ pub fn encode_control_success() -> Vec<u8> {
|
||||
encode_value(&Value::Boolean(true))
|
||||
}
|
||||
|
||||
pub fn encode_nil_response() -> Vec<u8> {
|
||||
encode_value(&Value::Nil)
|
||||
}
|
||||
|
||||
pub fn encode_router_control_stats(
|
||||
router: &LxmRouter,
|
||||
identity_hash: [u8; 16],
|
||||
|
||||
Reference in new issue
Block a user