From: Matt Joiner Date: Sun, 9 Oct 2016 13:04:14 +0000 (+1100) Subject: Reorder the fields of struct Client X-Git-Tag: v1.0.0~563 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=510c03770b1605d207ce9844755400819cf99e01;p=btrtrc.git Reorder the fields of struct Client --- 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 {