From 63d215568a5a7e56af893e131ac214b01d24cfde Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 19 Jul 2019 14:56:29 +1000 Subject: [PATCH] Tidy up function signature --- peer_protocol/handshake.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/peer_protocol/handshake.go b/peer_protocol/handshake.go index fe232948..b8cff0ff 100644 --- a/peer_protocol/handshake.go +++ b/peer_protocol/handshake.go @@ -69,11 +69,14 @@ type HandshakeResult struct { metainfo.Hash } -// ih is nil if we expect the peer to declare the InfoHash, such as when the -// peer initiated the connection. Returns ok if the Handshake was successful, -// and err if there was an unexpected condition other than the peer simply -// abandoning the Handshake. -func Handshake(sock io.ReadWriter, ih *metainfo.Hash, peerID [20]byte, extensions PeerExtensionBits) (res HandshakeResult, ok bool, err error) { +// ih is nil if we expect the peer to declare the InfoHash, such as when the peer initiated the +// connection. Returns ok if the Handshake was successful, and err if there was an unexpected +// condition other than the peer simply abandoning the Handshake. +func Handshake( + sock io.ReadWriter, ih *metainfo.Hash, peerID [20]byte, extensions PeerExtensionBits, +) ( + res HandshakeResult, ok bool, err error, +) { // Bytes to be sent to the peer. Should never block the sender. postCh := make(chan []byte, 4) // A single error value sent when the writer completes. -- 2.48.1