]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Minor tidying
authorMatt Joiner <anacrolix@gmail.com>
Mon, 21 Jun 2021 03:00:20 +0000 (13:00 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 21 Jun 2021 03:00:20 +0000 (13:00 +1000)
client.go
mse/mse.go

index c7a5f87c560ba7036524d11048fdbed0b00d24cf..e009255689a28e11892f98aeb778cc99dbbcc05a 100644 (file)
--- a/client.go
+++ b/client.go
@@ -778,12 +778,12 @@ func (cl *Client) initiateHandshakes(c *PeerConn, t *Torrent) error {
                )
                c.setRW(rw)
                if err != nil {
-                       return xerrors.Errorf("header obfuscation handshake: %w", err)
+                       return fmt.Errorf("header obfuscation handshake: %w", err)
                }
        }
        ih, err := cl.connBtHandshake(c, &t.infoHash)
        if err != nil {
-               return xerrors.Errorf("bittorrent protocol handshake: %w", err)
+               return fmt.Errorf("bittorrent protocol handshake: %w", err)
        }
        if ih != t.infoHash {
                return errors.New("bittorrent protocol handshake: peer infohash didn't match")
index a2f2d1d90eff349b557d249acda94ba272064093..a6010ec3a7dec3998cdbe61ab5ed5e6a2d019b7a 100644 (file)
@@ -541,7 +541,11 @@ func (h *handshake) Do() (ret io.ReadWriter, method CryptoMethod, err error) {
        return
 }
 
-func InitiateHandshake(rw io.ReadWriter, skey []byte, initialPayload []byte, cryptoProvides CryptoMethod) (ret io.ReadWriter, method CryptoMethod, err error) {
+func InitiateHandshake(
+       rw io.ReadWriter, skey []byte, initialPayload []byte, cryptoProvides CryptoMethod,
+) (
+       ret io.ReadWriter, method CryptoMethod, err error,
+) {
        h := handshake{
                conn:           rw,
                initer:         true,