diff --git a/src/net/rpc.rs b/src/net/rpc.rs index 35c48e11..4454866a 100644 --- a/src/net/rpc.rs +++ b/src/net/rpc.rs @@ -1,5 +1,7 @@ use crate::cli::CF; use crate::cnf::MAX_CONCURRENT_CALLS; +use crate::cnf::PKG_NAME; +use crate::cnf::PKG_VERS; use crate::dbs::DB; use crate::err::Error; use crate::net::session; @@ -209,6 +211,10 @@ impl Rpc { v if v.is_strand() => rpc.read().await.delete(v).await, _ => return Response::failure(id, Failure::INVALID_PARAMS).send(chn).await, }, + "version" => match params.len() { + 0 => Ok(format!("{}-{}", PKG_NAME, *PKG_VERS).into()), + _ => return Response::failure(id, Failure::INVALID_PARAMS).send(chn).await, + }, _ => return Response::failure(id, Failure::METHOD_NOT_FOUND).send(chn).await, }; // Return the final response