Add some debugging routes and envpprof to cmd/magnet-metainfo
https://github.com/anacrolix/torrent/issues/178
This commit is contained in:
parent
97cb41a5c9
commit
89f39b0b09
|
@ -4,9 +4,11 @@ package main
|
|||
import (
|
||||
"flag"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
_ "github.com/anacrolix/envpprof"
|
||||
"github.com/anacrolix/torrent"
|
||||
"github.com/anacrolix/torrent/bencode"
|
||||
)
|
||||
|
@ -17,6 +19,12 @@ func main() {
|
|||
if err != nil {
|
||||
log.Fatalf("error creating client: %s", err)
|
||||
}
|
||||
http.HandleFunc("/torrent", func(w http.ResponseWriter, r *http.Request) {
|
||||
cl.WriteStatus(w)
|
||||
})
|
||||
http.HandleFunc("/dht", func(w http.ResponseWriter, r *http.Request) {
|
||||
cl.DHT().WriteStatus(w)
|
||||
})
|
||||
wg := sync.WaitGroup{}
|
||||
for _, arg := range flag.Args() {
|
||||
t, err := cl.AddMagnet(arg)
|
||||
|
|
Loading…
Reference in New Issue