]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Helper method on Client's Torrent that tells where the metainfo file would be stored
authorMatt Joiner <anacrolix@gmail.com>
Tue, 30 Dec 2014 12:58:38 +0000 (23:58 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 30 Dec 2014 12:58:38 +0000 (23:58 +1100)
client.go

index c11d1a027dd7a44b40c913896cd2e864f732c946..0ddf41f72030e4649c4fc1b0048cf1df46a43b33 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1157,6 +1157,8 @@ func (me *Client) connectionLoop(t *torrent, c *connection) error {
                        for r := range c.Requests {
                                me.connDeleteRequest(t, c, r)
                        }
+                       // We can then reset our interest.
+                       me.replenishConnRequests(t, c)
                case pp.Unchoke:
                        c.PeerChoked = false
                        me.peerUnchoked(t, c)
@@ -1621,6 +1623,10 @@ type Torrent struct {
        *torrent
 }
 
+func (t Torrent) MetainfoFilepath() string {
+       return filepath.Join(t.cl.ConfigDir(), "torrents", t.InfoHash.HexString()+".torrent")
+}
+
 func (t Torrent) AddPeers(pp []Peer) error {
        return t.cl.AddPeers(t.torrent.InfoHash, pp)
 }