Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No error_code overload for the lt::load_torrent_* functions #7575

Open
dodicidodici opened this issue Dec 30, 2023 · 1 comment
Open

No error_code overload for the lt::load_torrent_* functions #7575

dodicidodici opened this issue Dec 30, 2023 · 1 comment

Comments

@dodicidodici
Copy link

Currently, the load_torrent_file, load_torrent_parsed, and load_torrent_buffer functions do not have an overload w/ lt::error_code.

add_torrent_params load_torrent_file(std::string const& filename, load_torrent_limits const& cfg)
{
add_torrent_params ret;
ret.ti = std::make_shared<torrent_info>(filename, cfg);
update_atp(ret);
return ret;
}
add_torrent_params load_torrent_buffer(span<char const> buffer, load_torrent_limits const& cfg)
{
add_torrent_params ret;
ret.ti = std::make_shared<torrent_info>(buffer, cfg, from_span);
update_atp(ret);
return ret;
}
add_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg)
{
add_torrent_params ret;
ret.ti = std::make_shared<torrent_info>(torrent_file, cfg);
update_atp(ret);
return ret;
}

The functions make use of the lt::torrent_info constructor, specifically the non-lt::error_code overload, which isn't available when building without support for exceptions.

@arvidn
Copy link
Owner

arvidn commented Feb 17, 2024

would you expect such overloads to return an optional<add_torrent_params>?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants