mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-02-25 18:55:38 -06:00
some debugging for bootstrap and route purge
This commit is contained in:
committed by
Christien Rioux
parent
97a9a8d3af
commit
7129343ea1
@@ -35,6 +35,7 @@ rt-tokio = [
|
||||
tracking = ["veilid-core/tracking"]
|
||||
network-result-extra = ["veilid-core/network-result-extra"]
|
||||
verbose-tracing = ["veilid-core/verbose-tracing"]
|
||||
debug-json-api = []
|
||||
|
||||
[dependencies]
|
||||
veilid-core = { path = "../veilid-core", default-features = false }
|
||||
|
||||
@@ -217,6 +217,9 @@ impl ClientApi {
|
||||
// (trim all whitespace around input lines just to make things more permissive for API users)
|
||||
let request: json_api::Request = deserialize_json(&sanitized_line)?;
|
||||
|
||||
#[cfg(feature = "debug-json-api")]
|
||||
debug!("JSONAPI: Request: {:?}", request);
|
||||
|
||||
// See if this is a control message or a veilid-core message
|
||||
let response = if let json_api::RequestOp::Control { args } = request.op {
|
||||
// Process control messages
|
||||
@@ -231,6 +234,9 @@ impl ClientApi {
|
||||
jrp.clone().process_request(request).await
|
||||
};
|
||||
|
||||
#[cfg(feature = "debug-json-api")]
|
||||
debug!("JSONAPI: Response: {:?}", response);
|
||||
|
||||
// Marshal json + newline => NDJSON
|
||||
let response_string = serialize_json(json_api::RecvMessage::Response(response)) + "\n";
|
||||
if let Err(e) = responses_tx.send_async(response_string).await {
|
||||
|
||||
Reference in New Issue
Block a user