fixed bug in url encoder and in client test
This commit is contained in:
parent
e22c6cdf62
commit
9977480f02
|
@ -24,6 +24,8 @@
|
||||||
incoming connection
|
incoming connection
|
||||||
* added more detailed instrumentation of the disk I/O thread
|
* added more detailed instrumentation of the disk I/O thread
|
||||||
|
|
||||||
|
* fixed bug in url encoder where $ would not be encoded
|
||||||
|
|
||||||
0.15 release
|
0.15 release
|
||||||
|
|
||||||
* introduced a session state save mechanism. load_state() and save_state().
|
* introduced a session state save mechanism. load_state() and save_state().
|
||||||
|
|
|
@ -559,6 +559,11 @@ void add_torrent(libtorrent::session& ses
|
||||||
p.duplicate_is_error = false;
|
p.duplicate_is_error = false;
|
||||||
p.auto_managed = true;
|
p.auto_managed = true;
|
||||||
torrent_handle h = ses.add_torrent(p, ec);
|
torrent_handle h = ses.add_torrent(p, ec);
|
||||||
|
if (ec)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "failed to add torrent: %s\n", ec.message().c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
handles.insert(std::pair<const std::string, torrent_handle>(
|
handles.insert(std::pair<const std::string, torrent_handle>(
|
||||||
monitored_dir?std::string(torrent):std::string(), h));
|
monitored_dir?std::string(torrent):std::string(), h));
|
||||||
|
@ -839,7 +844,7 @@ int main(int argc, char* argv[])
|
||||||
// interpret this as a torrent
|
// interpret this as a torrent
|
||||||
|
|
||||||
// first see if this is a torrentless download
|
// first see if this is a torrentless download
|
||||||
if (std::strstr("magnet:", argv[i]) == argv[i])
|
if (std::strstr(argv[i], "magnet:") == argv[i])
|
||||||
{
|
{
|
||||||
add_torrent_params p;
|
add_torrent_params p;
|
||||||
p.save_path = save_path;
|
p.save_path = save_path;
|
||||||
|
@ -883,7 +888,7 @@ int main(int argc, char* argv[])
|
||||||
torrent_handle h = ses.add_torrent(p, ec);
|
torrent_handle h = ses.add_torrent(p, ec);
|
||||||
if (ec)
|
if (ec)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s\n", ec.message().c_str());
|
fprintf(stderr, "failed to add torrent: %s\n", ec.message().c_str());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ namespace libtorrent
|
||||||
int piece_size(int index) const;
|
int piece_size(int index) const;
|
||||||
|
|
||||||
void set_name(std::string const& n) { m_name = n; }
|
void set_name(std::string const& n) { m_name = n; }
|
||||||
const std::string& name() const { TORRENT_ASSERT(m_piece_length > 0); return m_name; }
|
const std::string& name() const { return m_name; }
|
||||||
|
|
||||||
void swap(file_storage& ti)
|
void swap(file_storage& ti)
|
||||||
{
|
{
|
||||||
|
|
|
@ -212,10 +212,10 @@ namespace libtorrent
|
||||||
// % should be ok
|
// % should be ok
|
||||||
"%+"
|
"%+"
|
||||||
// reserved
|
// reserved
|
||||||
";?:@=&/"
|
";?:@=&,$/"
|
||||||
// unreserved (special characters) ' excluded,
|
// unreserved (special characters) ' excluded,
|
||||||
// since some buggy trackers fail with those
|
// since some buggy trackers fail with those
|
||||||
"$-_.!~*(),"
|
"-_!.~*()"
|
||||||
// unreserved (alphanumerics)
|
// unreserved (alphanumerics)
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
|
||||||
"0123456789";
|
"0123456789";
|
||||||
|
@ -250,12 +250,12 @@ namespace libtorrent
|
||||||
|
|
||||||
std::string escape_string(const char* str, int len)
|
std::string escape_string(const char* str, int len)
|
||||||
{
|
{
|
||||||
return escape_string_impl(str, len, 9);
|
return escape_string_impl(str, len, 11);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string escape_path(const char* str, int len)
|
std::string escape_path(const char* str, int len)
|
||||||
{
|
{
|
||||||
return escape_string_impl(str, len, 8);
|
return escape_string_impl(str, len, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool need_encoding(char const* str, int len)
|
bool need_encoding(char const* str, int len)
|
||||||
|
|
Loading…
Reference in New Issue