[Add] Connection Logging
This commit is contained in:
parent
9dd9a919f6
commit
b4e8e42267
2 changed files with 10 additions and 5 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
|
@ -700,7 +700,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "epsilon-core"
|
name = "epsilon-core"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/Tensamin/Epsilon.git#d5edc693a91954834a38c39517b79092983eac5c"
|
source = "git+https://github.com/Tensamin/Epsilon.git#bafbf13f43a9f7092341ec102621e234438be163"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
|
|
@ -712,7 +712,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "epsilon-native"
|
name = "epsilon-native"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/Tensamin/Epsilon.git#d5edc693a91954834a38c39517b79092983eac5c"
|
source = "git+https://github.com/Tensamin/Epsilon.git#bafbf13f43a9f7092341ec102621e234438be163"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"epsilon-core",
|
"epsilon-core",
|
||||||
"quinn",
|
"quinn",
|
||||||
|
|
@ -2780,9 +2780,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tinyvec"
|
name = "tinyvec"
|
||||||
version = "1.10.0"
|
version = "1.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa"
|
checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tinyvec_macros",
|
"tinyvec_macros",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
7
src/rho/connection.rs
Normal file → Executable file
7
src/rho/connection.rs
Normal file → Executable file
|
|
@ -6,7 +6,7 @@ use tokio::sync::RwLock;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
anonymous_clients::anonymous_client_connection::AnonymousClientConnection,
|
anonymous_clients::anonymous_client_connection::AnonymousClientConnection,
|
||||||
get_private_key, get_public_key, log_err, log_in, log_out,
|
get_private_key, get_public_key, log_cv_in, log_cv_out, log_err, log_in, log_out,
|
||||||
omega::omega_connection::get_omega_connection,
|
omega::omega_connection::get_omega_connection,
|
||||||
rho::{
|
rho::{
|
||||||
client_connection::ClientConnection, iota_connection::IotaConnection,
|
client_connection::ClientConnection, iota_connection::IotaConnection,
|
||||||
|
|
@ -66,6 +66,8 @@ impl GeneralConnection {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
log_cv_in!(cv);
|
||||||
|
|
||||||
if !*self.identified.read().await {
|
if !*self.identified.read().await {
|
||||||
self.handle_identification(cv).await;
|
self.handle_identification(cv).await;
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -147,6 +149,7 @@ impl GeneralConnection {
|
||||||
)
|
)
|
||||||
.add_data(DataTypes::challenge, DataValue::Str(encrypted_challenge));
|
.add_data(DataTypes::challenge, DataValue::Str(encrypted_challenge));
|
||||||
|
|
||||||
|
log_cv_out!(response);
|
||||||
let _ = self.sender.send(&response).await;
|
let _ = self.sender.send(&response).await;
|
||||||
} else if let DataValue::Number(user_id) = cv.get_data(DataTypes::user_id) {
|
} else if let DataValue::Number(user_id) = cv.get_data(DataTypes::user_id) {
|
||||||
*self.id.write().await = *user_id as u64;
|
*self.id.write().await = *user_id as u64;
|
||||||
|
|
@ -204,6 +207,7 @@ impl GeneralConnection {
|
||||||
)
|
)
|
||||||
.add_data(DataTypes::challenge, DataValue::Str(encrypted_challenge));
|
.add_data(DataTypes::challenge, DataValue::Str(encrypted_challenge));
|
||||||
|
|
||||||
|
log_cv_out!(response);
|
||||||
let _ = self.sender.send(&response).await;
|
let _ = self.sender.send(&response).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -224,6 +228,7 @@ impl GeneralConnection {
|
||||||
.with_id(cv.get_id())
|
.with_id(cv.get_id())
|
||||||
.add_data(DataTypes::accepted, DataValue::Bool(true));
|
.add_data(DataTypes::accepted, DataValue::Bool(true));
|
||||||
|
|
||||||
|
log_cv_out!(response);
|
||||||
if let Err(_) = self.sender.send(&response).await {
|
if let Err(_) = self.sender.send(&response).await {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue