diff --git a/ChangeLog b/ChangeLog index cb43b844c..875dbde86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,8 @@ incoming connection * added more detailed instrumentation of the disk I/O thread + * fixed bug in url encoder where $ would not be encoded + 0.15 release * introduced a session state save mechanism. load_state() and save_state(). diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 91e909712..085730eab 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -559,6 +559,11 @@ void add_torrent(libtorrent::session& ses p.duplicate_is_error = false; p.auto_managed = true; 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( monitored_dir?std::string(torrent):std::string(), h)); @@ -839,7 +844,7 @@ int main(int argc, char* argv[]) // interpret this as a torrent // 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; p.save_path = save_path; @@ -883,7 +888,7 @@ int main(int argc, char* argv[]) torrent_handle h = ses.add_torrent(p, ec); if (ec) { - fprintf(stderr, "%s\n", ec.message().c_str()); + fprintf(stderr, "failed to add torrent: %s\n", ec.message().c_str()); continue; } diff --git a/include/libtorrent/file_storage.hpp b/include/libtorrent/file_storage.hpp index a3d8a2223..999d023fe 100644 --- a/include/libtorrent/file_storage.hpp +++ b/include/libtorrent/file_storage.hpp @@ -136,7 +136,7 @@ namespace libtorrent int piece_size(int index) const; 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) { diff --git a/src/escape_string.cpp b/src/escape_string.cpp index 29c7e38a6..8f73f3e8f 100644 --- a/src/escape_string.cpp +++ b/src/escape_string.cpp @@ -212,10 +212,10 @@ namespace libtorrent // % should be ok "%+" // reserved - ";?:@=&/" + ";?:@=&,$/" // unreserved (special characters) ' excluded, // since some buggy trackers fail with those - "$-_.!~*()," + "-_!.~*()" // unreserved (alphanumerics) "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" "0123456789"; @@ -250,12 +250,12 @@ namespace libtorrent 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) { - return escape_string_impl(str, len, 8); + return escape_string_impl(str, len, 10); } bool need_encoding(char const* str, int len)