Thank you for your encouragement! I am busy the coming weeks, so I will stop here.ambipro wrote: ↑Sat Apr 13, 2024 3:09 pm You could open a ticket and submit a PR on the github with this, it seems like a very minor change that could solve this problem (assuming it was an oversight) - worst case, we will find out if there's a reason and perhaps another solution will be proposed or something.
Anyone interested please feel free to try out this idea, and do the real work.
Here are some more thoughts.
1. According to libtorrent source session_handle.hpp, the only valid save_state_flags_t in libtorrent v2 are:
Code: Select all
save_settings
save_dht_settings
save_dht_state
save_extension_state
save_ip_filter
2. According to session_impl.cpp, the only flags used in save_state are:
Code: Select all
save_settings
save_dht_settings
save_dht_state
3. Thus, if 1 andd 2 are correct, the modifictaion becomes:
replace:
Code: Select all
_file.write(lt.bencode(self.session.save_state()))
Code: Select all
state = self.session.save_state(flags=lt.save_state_flags_t.save_dht_state)
_file.write(lt.bencode(state))
Again, after modification, deluged starts and stops without error in debian 12. But I didn't do any futher testings.
4. In libtorrent v2, save_state/load_state have been depreciated. I have no idea how much work is required to rewrite using read_session_params/write_session_params.
P.S. Forgot that deluge 2.x supports libtorrent 1.2. Luckily, save_state() from libtorrent 1.2 seems the same as in libtorrent 2.0. So same modification might work in libtorrent 1.2 too.
Edit: I removed lt.save_state_flags_t.save_dht_settings from flags argument. Because ltconfig can modify dht settings, saving dht settings in session.state might result in 'stuck' dht settings.