This commit is contained in:
2026-06-02 23:57:15 +09:00
parent 57c5253513
commit 4b15a02fc7
+10 -7
View File
@@ -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