Michael Mckeown
2016-08-10 10:29:46 UTC
Hi,
or http.
Second thing is when creating a torrent with web seeds (torrent is
myfile.exe and seeds are http://mysite.com/myfile.exe or
http://mysite.com/myfile.exe/)
url/http seeds in torrent_status are not there (size 0 of set) but the
created torrent file won't open on utorrent (error invalid torrent file).
Thanks for any suggestions.
void delete_web_seed ( std::string hash , std::string url )
{
torrent_handle x = Session->find_torrent ( to_hash ( hash.c_str (
) ) );
if ( x.is_valid ( ) )
{
std::string::iterator it = url.end ( ) - 1;
if ( *it == '/' )
{
x.remove_url_seed ( url );
}
else
{
x.remove_http_seed ( url );
}
}
}
the hash and the url both check out but the seed is never deleted, url{
torrent_handle x = Session->find_torrent ( to_hash ( hash.c_str (
) ) );
if ( x.is_valid ( ) )
{
std::string::iterator it = url.end ( ) - 1;
if ( *it == '/' )
{
x.remove_url_seed ( url );
}
else
{
x.remove_http_seed ( url );
}
}
}
or http.
Second thing is when creating a torrent with web seeds (torrent is
myfile.exe and seeds are http://mysite.com/myfile.exe or
http://mysite.com/myfile.exe/)
create_torrent t ( fs , params.piece_size , pad_file_limit , flags );
for ( std::vector<std::string>::iterator i = params.web_seeds.begin (
) , end ( params.web_seeds.end ( ) ); i != end; ++i )
{
std::string url = *i;
std::string::iterator it = url.end ( ) - 1;
if ( *it == '/' )
{
t.add_url_seed ( url );
}
else
{
t.add_http_seed ( url );
}
}
the torrent creates without error and will open up on Libtorrent butfor ( std::vector<std::string>::iterator i = params.web_seeds.begin (
) , end ( params.web_seeds.end ( ) ); i != end; ++i )
{
std::string url = *i;
std::string::iterator it = url.end ( ) - 1;
if ( *it == '/' )
{
t.add_url_seed ( url );
}
else
{
t.add_http_seed ( url );
}
}
url/http seeds in torrent_status are not there (size 0 of set) but the
created torrent file won't open on utorrent (error invalid torrent file).
Thanks for any suggestions.