cmd/dht-get-peers/main.go | 3 ++- cmd/torrent/main.go | 7 ++----- cmd/torrentfs/main.go | 7 ++----- diff --git a/cmd/dht-get-peers/main.go b/cmd/dht-get-peers/main.go index 75d52e094b74d03428b48a889ca4195213e2d57b..40adb32ef2f1e3349499906c36a2520d539acfbc 100644 --- a/cmd/dht-get-peers/main.go +++ b/cmd/dht-get-peers/main.go @@ -9,6 +9,8 @@ "net" "os" "os/signal" + _ "github.com/anacrolix/envpprof" + "bitbucket.org/anacrolix/go.torrent/dht" "bitbucket.org/anacrolix/go.torrent/util" _ "bitbucket.org/anacrolix/go.torrent/util/profile" @@ -129,7 +131,6 @@ }() } func main() { - util.LoggedHTTPServe("") seen := make(map[util.CompactPeer]struct{}) getPeers: for { diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index 121a7b837671a59717f43edadb7b0863149481f1..54a541ce14fc1098974ac008713af7b0fce5b34f 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -10,16 +10,16 @@ _ "net/http/pprof" "os" "strings" + _ "github.com/anacrolix/envpprof" + "github.com/anacrolix/libtorgo/metainfo" "bitbucket.org/anacrolix/go.torrent" - "bitbucket.org/anacrolix/go.torrent/util" ) var ( downloadDir = flag.String("downloadDir", "", "directory to store download torrent data") testPeer = flag.String("testPeer", "", "bootstrap peer address") - httpAddr = flag.String("httpAddr", "localhost:6061", "http serve address") // TODO: Check the default torrent listen port. listenAddr = flag.String("listenAddr", ":50007", "incoming connection address") disableTrackers = flag.Bool("disableTrackers", false, "disable trackers") @@ -30,9 +30,6 @@ func main() { log.SetFlags(log.LstdFlags | log.Lshortfile) flag.Parse() - if *httpAddr != "" { - util.LoggedHTTPServe(*httpAddr) - } client, err := torrent.NewClient(&torrent.Config{ DataDir: *downloadDir, DisableTrackers: *disableTrackers, diff --git a/cmd/torrentfs/main.go b/cmd/torrentfs/main.go index b8a82535ab4ebb6940f76688b449f90267db8801..328e65dd11fabfb5b3e1bccebf4df1c190f68dfc 100644 --- a/cmd/torrentfs/main.go +++ b/cmd/torrentfs/main.go @@ -13,7 +13,8 @@ "path/filepath" "syscall" "time" - "bitbucket.org/anacrolix/go.torrent/util" + _ "github.com/anacrolix/envpprof" + "bitbucket.org/anacrolix/go.torrent/util/dirwatch" "bazil.org/fuse" @@ -35,7 +36,6 @@ mountDir = flag.String("mountDir", "", "location the torrent contents are made available") disableTrackers = flag.Bool("disableTrackers", false, "disables trackers") testPeer = flag.String("testPeer", "", "the address for a test peer") - httpAddr = flag.String("httpAddr", "localhost:0", "HTTP server bind address") readaheadBytes = flag.Int64("readaheadBytes", 10*1024*1024, "bytes to readahead in each torrent from the last read piece") listenAddr = flag.String("listenAddr", ":6882", "incoming connection address") @@ -90,9 +90,6 @@ os.Stderr.WriteString("y u no specify mountpoint?\n") os.Exit(2) } log.SetFlags(log.LstdFlags | log.Lshortfile) - if *httpAddr != "" { - util.LoggedHTTPServe(*httpAddr) - } conn, err := fuse.Mount(*mountDir) if err != nil { log.Fatal(err)