diff options
Diffstat (limited to 'src/block.rs')
-rw-r--r-- | src/block.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/block.rs b/src/block.rs index 879cff2c..60121ac5 100644 --- a/src/block.rs +++ b/src/block.rs @@ -14,11 +14,13 @@ use crate::data; use crate::data::*; use crate::error::Error; use crate::membership::System; -use crate::proto::*; use crate::rpc_client::*; use crate::rpc_server::*; use crate::server::Garage; +pub const INLINE_THRESHOLD: usize = 3072; + +const BLOCK_RW_TIMEOUT: Duration = Duration::from_secs(42); const NEED_BLOCK_QUERY_TIMEOUT: Duration = Duration::from_secs(5); const RESYNC_RETRY_TIMEOUT: Duration = Duration::from_secs(10); @@ -31,6 +33,14 @@ pub enum Message { NeedBlockReply(bool), } +#[derive(Debug, Serialize, Deserialize)] +pub struct PutBlockMessage { + pub hash: Hash, + + #[serde(with = "serde_bytes")] + pub data: Vec<u8>, +} + impl RpcMessage for Message {} pub struct BlockManager { |