From 510c03770b1605d207ce9844755400819cf99e01 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 10 Oct 2016 00:04:14 +1100 Subject: [PATCH] Reorder the fields of struct Client --- client.go | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/client.go b/client.go index 29aed198..23819096 100644 --- a/client.go +++ b/client.go @@ -57,29 +57,30 @@ func (cl *Client) queueFirstHash(t *Torrent, piece int) { // Clients contain zero or more Torrents. A Client manages a blocklist, the // TCP/UDP protocol ports, and DHT as desired. type Client struct { - halfOpenLimit int - peerID [20]byte - // The net.Addr.String part that should be common to all active listeners. - listenAddr string + mu sync.RWMutex + event sync.Cond + closed missinggo.Event + + config Config + + halfOpenLimit int + peerID [20]byte + defaultStorage *storage.Client tcpListener net.Listener utpSock *utp.Socket dHT *dht.Server ipBlockList iplist.Ranger - config Config + // Our BitTorrent protocol extension bytes, sent in our BT handshakes. extensionBytes peerExtensionBytes + // The net.Addr.String part that should be common to all active listeners. + listenAddr string + // Set of addresses that have our client ID. This intentionally will // include ourselves if we end up trying to connect to our own address // through legitimate channels. dopplegangerAddrs map[string]struct{} badPeerIPs map[string]struct{} - - defaultStorage *storage.Client - - mu sync.RWMutex - event sync.Cond - closed missinggo.Event - - torrents map[metainfo.Hash]*Torrent + torrents map[metainfo.Hash]*Torrent } func (cl *Client) BadPeerIPs() []string { -- 2.48.1