]> Sergey Matveev's repositories - btrtrc.git/blobdiff - client.go
Support individual peer max requests
[btrtrc.git] / client.go
index 4902a1962457177fefef38bbd650e3dbf13344fd..206cdd7c31268eb9add3743b9d08f72937b0f4c5 100644 (file)
--- a/client.go
+++ b/client.go
@@ -280,11 +280,12 @@ func (me *Client) initiateConn(peer Peer, torrent *torrent) {
 
 func (me *Client) runConnection(sock net.Conn, torrent *torrent) (err error) {
        conn := &connection{
-               Socket:     sock,
-               Choked:     true,
-               PeerChoked: true,
-               write:      make(chan []byte),
-               post:       make(chan encoding.BinaryMarshaler),
+               Socket:          sock,
+               Choked:          true,
+               PeerChoked:      true,
+               write:           make(chan []byte),
+               post:            make(chan encoding.BinaryMarshaler),
+               PeerMaxRequests: 250,
        }
        defer func() {
                // There's a lock and deferred unlock later in this function. The