From 7eb12013792e80fefd738139909e90bd089841f6 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 6 May 2019 21:37:01 -0700 Subject: [PATCH] connection: improve comments about protocol flow --- src/wormhole/_dilation/connection.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wormhole/_dilation/connection.py b/src/wormhole/_dilation/connection.py index 8bb82aa..4db1545 100644 --- a/src/wormhole/_dilation/connection.py +++ b/src/wormhole/_dilation/connection.py @@ -69,9 +69,13 @@ class Disconnect(Exception): # (everything past this point is a Frame, with be4 length prefix. Frames are # either noise handshake or an encrypted message) # 4: if LEADER, send noise handshake string. if FOLLOWER, wait for it +# LEADER: m=n.write_message(), FOLLOWER: n.read_message(m) # 5: if FOLLOWER, send noise response string. if LEADER, wait for it -# 6: ... - +# FOLLOWER: m=n.write_message(), LEADER: n.read_message(m) +# 6: if FOLLOWER: send KCM (m=n.encrypt('')), wait for KCM (n.decrypt(m)) +# if LEADER: wait for KCM, gather viable connections, select +# send KCM over selected connection, drop the rest +# 7: both: send Ping/Pong/Open/Data/Close/Ack records (n.encrypt(rec)) RelayOK = namedtuple("RelayOk", [])