WIP
This commit is contained in:
+10
-7
@@ -101,6 +101,7 @@ do_connect(State = #s{host = Host = {Addr, Port}}, Ref, From) ->
|
||||
end.
|
||||
|
||||
|
||||
|
||||
handshake(State = #s{socket = Socket}, Ref, From, TempKey) ->
|
||||
ok = active_once(State),
|
||||
receive
|
||||
@@ -108,6 +109,15 @@ handshake(State = #s{socket = Socket}, Ref, From, TempKey) ->
|
||||
PermanentID = gmser_api_encoder:encode(account_pubkey, PPK),
|
||||
EphemeralID = gmser_api_encoder:encode(account_pubkey, EPK),
|
||||
tell(info, "Got keys ~s, ~s", [PermanentID, EphemeralID]),
|
||||
{tcp_closed, Socket} ->
|
||||
From ! {Ref, {error, tcp_closed}},
|
||||
retire(State, normal, "Handshake died")
|
||||
after 5000 ->
|
||||
From ! {Ref, {error, timeout}},
|
||||
retire(State, normal, "Handshake timed out")
|
||||
end.
|
||||
|
||||
|
||||
% case is_sus(Challenge) of
|
||||
% false ->
|
||||
% tell(info, "Not sus"),
|
||||
@@ -118,13 +128,6 @@ handshake(State = #s{socket = Socket}, Ref, From, TempKey) ->
|
||||
% From ! {Ref, {error, "Challenge was sus."}},
|
||||
% retire(State, normal)
|
||||
% end;
|
||||
{tcp_closed, Socket} ->
|
||||
From ! {Ref, {error, tcp_closed}},
|
||||
retire(State, normal, "Handshake died")
|
||||
after 5000 ->
|
||||
From ! {Ref, {error, timeout}},
|
||||
retire(State, normal, "Handshake timed out")
|
||||
end.
|
||||
|
||||
%is_sus(Challenge) ->
|
||||
% case string:split(Challenge, "_", all) of
|
||||
|
||||
Reference in New Issue
Block a user