peer_protocol/handshake.go | 13 ++++++++----- diff --git a/peer_protocol/handshake.go b/peer_protocol/handshake.go index fe232948b562a1898dfcf14d5212411af5a98ef3..b8cff0ff00761a122d0ea450ac7a785175520586 100644 --- a/peer_protocol/handshake.go +++ b/peer_protocol/handshake.go @@ -69,11 +69,14 @@ PeerID [20]byte 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.