|
35 | 35 | #include <libtorrent/torrent_info.hpp> |
36 | 36 |
|
37 | 37 | #if LIBTORRENT_VERSION_NUM >= 20000 |
38 | | -#include <libtorrent/download_priority.hpp> // lt::download_priority_t, |
39 | | - // lt::dont_download |
40 | | -#include <libtorrent/units.hpp> // lt::file_index_t |
41 | | -#include <libtorrent/aux_/vector.hpp> // lt::aux::vector<> |
| 38 | +// lt::disabled_disk_io_constructor: |
| 39 | +#include <libtorrent/disabled_disk_io.hpp> |
| 40 | +// lt::download_priority_t, lt::dont_download: |
| 41 | +#include <libtorrent/download_priority.hpp> |
| 42 | +#include <libtorrent/units.hpp> // lt::file_index_t |
| 43 | +#include <libtorrent/aux_/vector.hpp> // lt::aux::vector<> |
42 | 44 | #endif |
43 | 45 |
|
44 | 46 | static int usage(const char *argv0) { |
@@ -158,14 +160,16 @@ int main(int argc, char *argv[]) { |
158 | 160 | */ |
159 | 161 | #else |
160 | 162 | // Create session_params and session. The ut_metadata extension |
161 | | - // (plugin) is requited to get .torrent metadata via magnet: link, |
| 163 | + // (plugin) is required to get .torrent metadata via 'magnet:' link, |
162 | 164 | // but the other two default plugins (ut_pex and smart_ban) aren't. |
163 | 165 | using plgnwrp = lt::aux::session_impl::session_plugin_wrapper; |
164 | 166 | std::vector<std::shared_ptr<lt::plugin>> exts; |
165 | 167 | exts.push_back( |
166 | 168 | std::make_shared<plgnwrp>(<::create_ut_metadata_plugin)); |
167 | 169 | lt::session_params sparams(spack, exts); |
168 | | - // sparams.disk_io_constructor = lt::disabled_disk_io_constructor(); |
| 170 | +#if LIBTORRENT_VERSION_NUM >= 20000 |
| 171 | + sparams.disk_io_constructor = <::disabled_disk_io_constructor; |
| 172 | +#endif |
169 | 173 | lt::session sess(sparams); |
170 | 174 | // sess.add_extension(<::create_ut_pex_plugin); |
171 | 175 | // sess.add_extension(<::create_smart_ban_plugin); |
|
0 commit comments