Skip to content
This repository has been archived by the owner on Dec 22, 2024. It is now read-only.

Commit

Permalink
fix/session_mapping
Browse files Browse the repository at this point in the history
ensure session is tracked properly per client, allow it to be sent in initial handshake
  • Loading branch information
JarbasAl committed Jul 1, 2024
1 parent e54626b commit 6f753af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hivemind_core/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,13 @@ def handle_handshake_message(
client.socket.close()
return

LOG.debug(f"client session_id: {client.sess.session_id}")
LOG.debug(f"client site_id: {client.sess.site_id}")
if client.sess.session_id != "default":
LOG.debug(f"client session_id: {client.sess.session_id}")
self.clients[client.peer] = client
else:
LOG.warning("client did not send a session in it's handshake")

msg = HiveMessage(HiveMessageType.HANDSHAKE, payload)
client.send(msg) # client can recreate crypto_key on his side now

Expand Down

0 comments on commit 6f753af

Please sign in to comment.