From 5dd59e437d5af84dfa2cf5dcc2c15807b971002d Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sat, 11 Apr 2020 23:00:26 +0200 Subject: Local refcounting of blocks --- src/rpc_server.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/rpc_server.rs') diff --git a/src/rpc_server.rs b/src/rpc_server.rs index 98798614..08fa909d 100644 --- a/src/rpc_server.rs +++ b/src/rpc_server.rs @@ -9,7 +9,6 @@ use hyper::service::{make_service_fn, service_fn}; use hyper::{Body, Method, Request, Response, Server, StatusCode}; use serde::Serialize; -use crate::block::*; use crate::data::rmp_to_vec_all_named; use crate::error::Error; use crate::proto::Message; @@ -65,8 +64,8 @@ async fn handler( Message::AdvertiseNodesUp(adv) => sys.handle_advertise_nodes_up(adv).await, Message::AdvertiseConfig(adv) => sys.handle_advertise_config(adv).await, - Message::PutBlock(m) => write_block(garage, &m.hash, &m.data).await, - Message::GetBlock(h) => read_block(garage, &h).await, + Message::PutBlock(m) => garage.block_manager.write_block(&m.hash, &m.data).await, + Message::GetBlock(h) => garage.block_manager.read_block(&h).await, Message::TableRPC(table, msg) => { if let Some(rpc_handler) = garage.table_rpc_handlers.get(table) { -- cgit v1.2.3