mirror of
https://github.com/codex-storage/nim-libp2p.git
synced 2025-01-12 20:14:09 +00:00
small cleanup
This commit is contained in:
parent
8dda6c289d
commit
bae4713a85
@ -16,6 +16,7 @@ import ../../peer
|
||||
import ../../peerinfo
|
||||
import ../../protobuf/minprotobuf
|
||||
import ../../utility
|
||||
import ../../stream/lpstream
|
||||
import secure,
|
||||
../../crypto/[crypto, chacha20poly1305, curve25519, hkdf],
|
||||
../../stream/bufferstream
|
||||
@ -426,9 +427,9 @@ method readMessage(sconn: NoiseConnection): Future[seq[byte]] {.async.} =
|
||||
var plain = sconn.readCs.decryptWithAd([], cipher)
|
||||
unpackNoisePayload(plain)
|
||||
return plain
|
||||
except AsyncStreamIncompleteError:
|
||||
except LPStreamIncompleteError:
|
||||
trace "Connection dropped while reading"
|
||||
except AsyncStreamReadError:
|
||||
except LPStreamReadError:
|
||||
trace "Error reading from connection"
|
||||
|
||||
method writeMessage(sconn: NoiseConnection, message: seq[byte]): Future[void] {.async.} =
|
||||
@ -508,7 +509,7 @@ method handshake*(p: Noise, conn: Connection, initiator: bool = false): Future[S
|
||||
secure.readCs = handshakeRes.cs1
|
||||
secure.writeCs = handshakeRes.cs2
|
||||
|
||||
debug "Noise handshake completed!"
|
||||
trace "Noise handshake completed!"
|
||||
|
||||
return secure
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user