From: Matt Joiner Date: Fri, 19 Jul 2019 04:56:29 +0000 (+1000) Subject: Tidy up function signature X-Git-Tag: v1.5.0~9 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=63d215568a5a7e56af893e131ac214b01d24cfde;p=btrtrc.git Tidy up function signature --- 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.