Improve WIP logging

This commit is contained in:
Olivier 'reivilibre' 2022-01-20 18:40:01 +00:00
parent 45cbd2d0db
commit 5a08dc1c88
2 changed files with 6 additions and 5 deletions

View File

@ -1,5 +1,5 @@
use crate::messages::HelloMessage; use crate::messages::HelloMessage;
use anyhow::{anyhow, bail}; use anyhow::{anyhow, bail, Context};
use quinn::{ReadExactError, RecvStream, SendStream}; use quinn::{ReadExactError, RecvStream, SendStream};
use serde::de::DeserializeOwned; use serde::de::DeserializeOwned;
use serde::Serialize; use serde::Serialize;
@ -15,8 +15,7 @@ pub async fn read_bare_message<M: DeserializeOwned>(
return if err == ReadExactError::FinishedEarly { return if err == ReadExactError::FinishedEarly {
Ok(None) Ok(None)
} else { } else {
Err(err)?; return Err(err).context("reading BARE message");
todo!()
}; };
} }
let control_message_length = u32::from_be_bytes(u32_buf) as usize; let control_message_length = u32::from_be_bytes(u32_buf) as usize;

View File

@ -1,7 +1,7 @@
use crate::server::file_access::{ClientInformation, ClientSpecificState, ServerwideState}; use crate::server::file_access::{ClientInformation, ClientSpecificState, ServerwideState};
use anyhow::Context; use anyhow::Context;
use futures_util::StreamExt; use futures_util::StreamExt;
use log::error; use log::{error, info};
use olivefs_common::messages::DataCommand; use olivefs_common::messages::DataCommand;
use olivefs_common::networking::read_bare_message; use olivefs_common::networking::read_bare_message;
use quinn::{NewConnection, RecvStream, SendStream}; use quinn::{NewConnection, RecvStream, SendStream};
@ -19,7 +19,9 @@ pub async fn handle_command_stream(
.context("Whilst waiting for Data Command")? .context("Whilst waiting for Data Command")?
{ {
match command { match command {
DataCommand::GetAttr { vnode: _ } => {} DataCommand::GetAttr { vnode: _ } => {
info!("getattr Not Implemented");
}
} }
} }