cmd/torrent/main.go | 6 +++--- diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index 03582ab6782fd502342b5018726bcde89d07e0c2..7cf6a2554cddd6c98682e393379b9978aa9720e0 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -131,7 +131,7 @@ var flags = struct { Mmap bool `help:"memory-map torrent data"` TestPeer []*net.TCPAddr `help:"addresses of some starting peers"` Seed bool `help:"seed after download is complete"` - Addr *net.TCPAddr `help:"network listen addr"` + Addr string `help:"network listen addr"` UploadRate tagflag.Bytes `help:"max piece bytes to send per second"` DownloadRate tagflag.Bytes `help:"max bytes per second down from peers"` Debug bool @@ -199,8 +199,8 @@ } if flags.Mmap { clientConfig.DefaultStorage = storage.NewMMap("") } - if flags.Addr != nil { - clientConfig.SetListenAddr(flags.Addr.String()) + if flags.Addr != "" { + clientConfig.SetListenAddr(flags.Addr) } if flags.UploadRate != -1 { clientConfig.UploadRateLimiter = rate.NewLimiter(rate.Limit(flags.UploadRate), 256<<10)