From a0a85e3c0fe9ade9fb3c9171e99e2c8d0308293f Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Sun, 30 Jun 2019 16:47:56 +0200 Subject: at p11 client disconnect, server asks manager to kill remote Also, comment out all debug printouts reporting about octets sent and received, all four types. Missing: Switching remote behind the back of the p11 client, including replaying whatever needs to be replayed. --- p11p-daemon/src/p11p_remote.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'p11p-daemon/src/p11p_remote.erl') diff --git a/p11p-daemon/src/p11p_remote.erl b/p11p-daemon/src/p11p_remote.erl index e40e2e2..200afdc 100644 --- a/p11p-daemon/src/p11p_remote.erl +++ b/p11p-daemon/src/p11p_remote.erl @@ -58,7 +58,7 @@ init([TokName, ModPath]) -> handle_call({add_to_outbuf, Data}, _From, State) -> {reply, ok, do_add_to_outbuf(Data, State)}; handle_call({request, Request}, {FromPid, _Tag}, #state{port = Port} = State) -> - lager:debug("~p: sending request from ~p to remote ~p", [self(), FromPid, Port]), + %%lager:debug("~p: sending request from ~p to remote ~p", [self(), FromPid, Port]), NewState = do_send(do_add_to_outbuf(p11p_rpc:serialise(Request), State)), {reply, ok, NewState#state{replyto = FromPid, timer = start_timer(Port)}}; handle_call(Request, _From, State) -> @@ -95,12 +95,12 @@ code_change(_OldVersion, State, _Extra) -> %% Private do_add_to_outbuf(Data, #state{outbuf = Buf} = State) -> - lager:debug("~p: adding ~B octets to outbuf", [self(), size(Data)]), + %%lager:debug("~p: adding ~B octets to outbuf", [self(), size(Data)]), NewBuf = <>, State#state{outbuf = NewBuf}. do_send(#state{port = Port, outbuf = Buf} = State) -> - lager:debug("~p: sending ~B octets to remote", [self(), size(Buf)]), + %%lager:debug("~p: sending ~B octets to remote", [self(), size(Buf)]), port_command(Port, Buf), State#state{outbuf = <<>>}. @@ -115,9 +115,9 @@ handle_remote_data(#state{replyto = Pid, timer = Timer} = State, Msg, Data) -> end. start_timer(Port) -> - lager:debug("~p: starting timer", [self()]), + %%lager:debug("~p: starting timer", [self()]), erlang:start_timer(3000, self(), Port). cancel_timer(Timer) -> - lager:debug("~p: canceling timer", [self()]), + %%lager:debug("~p: canceling timer", [self()]), erlang:cancel_timer(Timer, [{async, true}, {info, false}]). -- cgit v1.1