]> Sergey Matveev's repositories - btrtrc.git/blobdiff - cmd/torrentfs/main.go
Support different hosts for each network
[btrtrc.git] / cmd / torrentfs / main.go
index 4d9119da970347bb8e3bf772eeaa552672590bab..3cc778124e11bf7575ede99c00071adf2f6ece3e 100644 (file)
@@ -86,12 +86,13 @@ func mainExitCode() int {
        defer fuse.Unmount(args.MountDir)
        // TODO: Think about the ramifications of exiting not due to a signal.
        defer conn.Close()
-       client, err := torrent.NewClient(&torrent.Config{
+       cfg := torrent.Config{
                DataDir:         args.DownloadDir,
                DisableTrackers: args.DisableTrackers,
-               ListenAddr:      args.ListenAddr.String(),
                NoUpload:        true, // Ensure that downloads are responsive.
-       })
+       }
+       cfg.SetListenAddr(args.ListenAddr.String())
+       client, err := torrent.NewClient(&cfg)
        if err != nil {
                log.Print(err)
                return 1