Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vendor to get new anacrolix/torrent #239

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
503 changes: 503 additions & 0 deletions Gopkg.lock

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


[[constraint]]
name = "github.com/NYTimes/gziphandler"
version = "1.0.1"

[[constraint]]
branch = "master"
name = "github.com/anacrolix/dht"

[[constraint]]
branch = "master"
name = "github.com/anacrolix/torrent"

[[constraint]]
name = "github.com/elazarl/go-bindata-assetfs"
version = "1.0.0"

[[constraint]]
branch = "master"
name = "github.com/jpillora/archive"

[[constraint]]
name = "github.com/jpillora/backoff"
version = "1.0.0"

[[constraint]]
branch = "master"
name = "github.com/jpillora/cookieauth"

[[constraint]]
branch = "master"
name = "github.com/jpillora/opts"

[[constraint]]
branch = "master"
name = "github.com/jpillora/requestlog"

[[constraint]]
name = "github.com/jpillora/scraper"
version = "0.1.4"

[[constraint]]
branch = "master"
name = "github.com/jpillora/velox"

[[constraint]]
name = "github.com/shirou/gopsutil"
version = "2.18.5"

[[constraint]]
branch = "master"
name = "github.com/skratchdot/open-golang"

[prune]
go-tests = true
unused-packages = true
15 changes: 6 additions & 9 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"os"
"path/filepath"
"strconv"
"sync"
"time"

Expand Down Expand Up @@ -41,13 +40,11 @@ func (e *Engine) Configure(c Config) error {
return fmt.Errorf("Invalid incoming port (%d)", c.IncomingPort)
}
tc := torrent.Config{
DHTConfig: dht.ServerConfig{
StartingNodes: dht.GlobalBootstrapAddrs,
},
DataDir: c.DownloadDirectory,
ListenAddr: "0.0.0.0:" + strconv.Itoa(c.IncomingPort),
NoUpload: !c.EnableUpload,
Seed: c.EnableSeeding,
DhtStartingNodes: dht.GlobalBootstrapAddrs,
DataDir: c.DownloadDirectory,
ListenPort: c.IncomingPort,
NoUpload: !c.EnableUpload,
Seed: c.EnableSeeding,
}
tc.DisableEncryption = c.DisableEncryption

Expand Down Expand Up @@ -218,7 +215,7 @@ func (e *Engine) StartFile(infohash, filepath string) error {
}
t.Started = true
f.Started = true
f.f.PrioritizeRegion(0, f.Size)
f.f.Download()
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion engine/torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type File struct {
//cloud torrent
Started bool
Percent float32
f torrent.File
f *torrent.File
}

func (torrent *Torrent) Update(t *torrent.Torrent) {
Expand Down
8 changes: 4 additions & 4 deletions server/server_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ type stats struct {
GoMemory int64 `json:"goMemory"`
GoRoutines int `json:"goRoutines"`
//internal
lastCPUStat *cpu.CPUTimesStat
lastCPUStat *cpu.TimesStat
pusher velox.Pusher
}

func (s *stats) loadStats(diskDir string) {
//count cpu cycles between last count
if stats, err := cpu.CPUTimes(false); err == nil {
if stats, err := cpu.Times(false); err == nil {
stat := stats[0]
total := totalCPUTime(stat)
last := s.lastCPUStat
Expand All @@ -43,7 +43,7 @@ func (s *stats) loadStats(diskDir string) {
s.lastCPUStat = &stat
}
//count disk usage
if stat, err := disk.DiskUsage(diskDir); err == nil {
if stat, err := disk.Usage(diskDir); err == nil {
s.DiskUsed = int64(stat.Used)
s.DiskTotal = int64(stat.Total)
}
Expand All @@ -63,7 +63,7 @@ func (s *stats) loadStats(diskDir string) {
s.pusher.Push()
}

func totalCPUTime(t cpu.CPUTimesStat) float64 {
func totalCPUTime(t cpu.TimesStat) float64 {
total := t.User + t.System + t.Nice + t.Iowait + t.Irq + t.Softirq + t.Steal + t.Guest + t.GuestNice + t.Idle
return total
}
38 changes: 30 additions & 8 deletions vendor/github.com/NYTimes/gziphandler/gzip.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions vendor/github.com/PuerkitoBio/goquery/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 58 additions & 3 deletions vendor/github.com/PuerkitoBio/goquery/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading