From 7bdd60c7f99df417b2589f0e99ff16abc8e925c5 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 10 Oct 2018 16:48:38 +0200 Subject: Connecting works, but the rest probably doesnt --- shard/lib/app/pagestore.ex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'shard/lib/app/pagestore.ex') diff --git a/shard/lib/app/pagestore.ex b/shard/lib/app/pagestore.ex index f093ed4..e09c513 100644 --- a/shard/lib/app/pagestore.ex +++ b/shard/lib/app/pagestore.ex @@ -107,7 +107,7 @@ defmodule SApp.PageStore do case prefer_ask do [_|_] -> for peer <- prefer_ask do - Shard.Manager.send(peer, {state.shard_id, state.path, {:get, key}}) + Shard.Manager.send_pid(peer, {state.shard_id, state.path, {:get, key}}) end _ -> ask_random_peers(state, key) @@ -123,14 +123,14 @@ defmodule SApp.PageStore do {:noreply, state} end - def handle_cast({:msg, peer_id, _shard_id, _path, msg}, state) do + def handle_cast({:msg, conn_pid, _auth, _shard_id, _path, msg}, state) do state = case msg do {:get, key} -> case :dets.lookup state.store, key do [{_, _, bin}] -> - Shard.Manager.send(peer_id, {state.shard_id, state.path, {:info, key, bin}}) + Shard.Manager.send_pid(conn_pid, {state.shard_id, state.path, {:info, key, bin}}) _ -> - Shard.Manager.send(peer_id, {state.shard_id, state.path, {:not_found, key}}) + Shard.Manager.send_pid(conn_pid, {state.shard_id, state.path, {:not_found, key}}) end state {:info, hash, bin} -> @@ -157,7 +157,7 @@ defmodule SApp.PageStore do value = SData.term_unbin bin for dep <- SData.Page.refs value do if :dets.lookup state.store, dep == [] do - init_rec_pull(state, dep, sub_why, [peer_id]) + init_rec_pull(state, dep, sub_why, [conn_pid]) end end end -- cgit v1.2.3