From 011df568b7f6315fe81b0fe531e64803d6bf7c28 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Sat, 14 Sep 2019 09:55:58 -0600 Subject: [PATCH] finished integrating secio --- libp2p/multistream.nim | 22 +++++++++++----------- libp2p/protocols/identify.nim | 2 +- libp2p/protocols/secure/secio.nim | 4 +++- libp2p/switch.nim | 19 ++++++++++++++++--- tests/testswitch.nim | 2 +- 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/libp2p/multistream.nim b/libp2p/multistream.nim index fcb0e88cc..a15e6cf99 100644 --- a/libp2p/multistream.nim +++ b/libp2p/multistream.nim @@ -52,7 +52,7 @@ proc select*(m: MultisteamSelect, ## select a remote protocol await conn.write(m.codec) # write handshake if proto.len() > 0: - info "selecting proto", proto = proto + trace "selecting proto", proto = proto await conn.writeLp((proto[0] & "\n")) # select proto result = cast[string](await conn.readLp()) # read ms header @@ -65,14 +65,14 @@ proc select*(m: MultisteamSelect, return result = cast[string](await conn.readLp()) # read the first proto - info "reading first requested proto" + trace "reading first requested proto" result.removeSuffix("\n") if result == proto[0]: debug "succesfully selected ", proto = proto return if not result.len > 0: - info "selecting one of several protos" + trace "selecting one of several protos" for p in proto[1..