anacrolix / torrent

Full-featured BitTorrent client package and utilities
Mozilla Public License 2.0
5.41k stars 616 forks source link

Support changing seeding config after initialization #479

Open ghost opened 3 years ago

ghost commented 3 years ago

How can I do it? There is ClientConfig.Seed but how can I change it during runtime ?

anacrolix commented 3 years ago

This will need to be exposed. It probably wouldn't hurt to expose stuff like download/upload ratio too to enable users to make use of that in configuring seeding.

ghost commented 3 years ago

Can you please expose seed and download/upload ratio ?

anacrolix commented 3 years ago

I will look into it if I have time, cheers.

ghost commented 3 years ago

Hello, what's the progress on this? also, to change iplist.Ranger , should we lock client's mutex before changing? if yes, can you please create wrapper function to perform so?

anacrolix commented 3 years ago

Sorry, I'm not working on this currently.

anacrolix commented 3 years ago

This remains a valid enhancement. Possibly related to https://github.com/anacrolix/torrent/issues/155.

ghost commented 3 years ago

@anacrolix , Possible workarounds include ranging through torrents in client and if they are completed, disable data upload

anacrolix commented 3 years ago

Yeah, there are definitely workarounds. Good thinking.

ghost commented 3 years ago

https://github.com/anacrolix/torrent/blob/b21aebeaae6a308d97e9f952c78639bc594e73fd/torrent.go#L1363

So, Config is directly been referenced. so,it would be easy to implement this feature,no?

ghost commented 3 years ago

@anacrolix can you provide method to change Seed value of config(while mutex locking it) ?

It must solve this issue.right?

anacrolix commented 3 years ago

Yes that would work. There might be a few condition values to tickle or something too.

gitpubber commented 3 years ago

https://github.com/anacrolix/torrent/pull/527 @anacrolix