Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
majestrate committed Sep 13, 2017
1 parent c881234 commit f6ac605
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/xd/lib/bittorrent/swarm/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"xd/lib/util"
)

const DefaultMaxParallelRequests = 4
const DefaultMaxParallelRequests = 8

// a peer connection
type PeerConn struct {
Expand Down
2 changes: 1 addition & 1 deletion src/xd/lib/bittorrent/swarm/piece.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (pt *pieceTracker) nextRequestForDownload(remote *bittorrent.Bitfield) (r *
for k := range pt.requests {
exclude = append(exclude, k)
}
log.Debugf("get next piece excluding %s", exclude)
log.Debugf("get next piece excluding %d", exclude)
idx = pt.nextPiece(remote, exclude)
_, has := pt.requests[idx]
if !has {
Expand Down
2 changes: 1 addition & 1 deletion src/xd/lib/bittorrent/swarm/torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func newTorrent(st storage.Torrent) *Torrent {
Trackers: make(map[string]tracker.Announcer),
announcers: make(map[string]*torrentAnnounce),
st: st,
piece: make(chan pieceEvent),
piece: make(chan pieceEvent, 64),
ibconns: make(map[string]*PeerConn),
obconns: make(map[string]*PeerConn),
defaultOpts: extensions.New(),
Expand Down
2 changes: 1 addition & 1 deletion src/xd/lib/config/bittorrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (c *BittorrentConfig) Load(s *configparser.Section) error {
c.PEX = s.Get("pex", "1") == "1"
c.OpenTrackers.FileName = s.Get("tracker-config", c.OpenTrackers.FileName)
var e error
c.PieceWindowSize, e = strconv.Atoi(s.Get("piece_window", fmt.Sprintf("%d", swarm.DefaultMaxParallelRequests)))
c.PieceWindowSize, e = strconv.Atoi(s.Get("piece-window", fmt.Sprintf("%d", swarm.DefaultMaxParallelRequests)))
if e != nil {
c.PieceWindowSize = swarm.DefaultMaxParallelRequests
}
Expand Down

0 comments on commit f6ac605

Please sign in to comment.