mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-14 22:22:31 +00:00
* Handshake was setting wrong bitfield size.
* Cleanup of Block classes. * Added brackets to error message from the OpenSSL test. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@713 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -112,9 +112,10 @@ DownloadFactory::receive_load() {
|
||||
m_variables.set("tied_to_file", (int64_t)false);
|
||||
|
||||
} else {
|
||||
m_stream = new std::fstream(rak::path_expand(m_uri).c_str(), std::ios::in | std::ios::binary);
|
||||
std::fstream* stream = new std::fstream(rak::path_expand(m_uri).c_str(), std::ios::in | std::ios::binary);
|
||||
m_stream = stream;
|
||||
|
||||
if (m_stream->good())
|
||||
if (stream->is_open())
|
||||
receive_loaded();
|
||||
else
|
||||
receive_failed("Could not open file");
|
||||
@@ -201,7 +202,7 @@ DownloadFactory::receive_success() {
|
||||
// This torrent was queued for hashing or hashing when the session
|
||||
// file was saved. Or it was in a started state.
|
||||
if (download->variable()->get_value("hashing") != Download::variable_hashing_stopped ||
|
||||
download->variable()->get_value("state") != 0)
|
||||
download->variable()->get_value("state") != 0)
|
||||
m_manager->download_list()->resume(download);
|
||||
|
||||
} else {
|
||||
@@ -236,7 +237,7 @@ DownloadFactory::initialize_rtorrent(Download* download, torrent::Object* rtorre
|
||||
rtorrent->insert_key("state_changed", cachedTime.seconds());
|
||||
|
||||
} else if (!rtorrent->has_key_value("state_changed") ||
|
||||
rtorrent->get_key("state_changed").as_value() > cachedTime.seconds() || rtorrent->get_key("state_changed").as_value() == 0) {
|
||||
rtorrent->get_key("state_changed").as_value() > cachedTime.seconds() || rtorrent->get_key("state_changed").as_value() == 0) {
|
||||
rtorrent->insert_key("state_changed", cachedTime.seconds());
|
||||
}
|
||||
|
||||
|
||||
+10
-7
@@ -316,6 +316,9 @@ path_expand(std::vector<std::string>* paths, const std::string& pattern) {
|
||||
if ((*first).empty()) {
|
||||
currentCache.push_back(utils::Directory("/"));
|
||||
++first;
|
||||
} else if (rak::trim(*first) == "~") {
|
||||
currentCache.push_back(utils::Directory("~/"));
|
||||
++first;
|
||||
} else {
|
||||
currentCache.push_back(utils::Directory("./"));
|
||||
}
|
||||
@@ -349,17 +352,17 @@ path_expand(std::vector<std::string>* paths, const std::string& pattern) {
|
||||
void
|
||||
Manager::try_create_download_expand(const std::string& uri, bool start, bool printLog, bool tied) {
|
||||
std::vector<std::string> paths;
|
||||
paths.reserve(32);
|
||||
paths.reserve(256);
|
||||
|
||||
path_expand(&paths, uri);
|
||||
|
||||
if (tied)
|
||||
for (std::vector<std::string>::iterator itr = paths.begin(); itr != paths.end(); )
|
||||
if (std::find_if(m_downloadList->begin(), m_downloadList->end(),
|
||||
rak::equal(*itr, rak::bind2nd(std::mem_fun(&Download::variable_string), "tied_to_file"))) != m_downloadList->end())
|
||||
itr = paths.erase(itr);
|
||||
if (std::find_if(m_downloadList->begin(), m_downloadList->end(), rak::equal(*itr, rak::bind2nd(std::mem_fun(&Download::variable_string), "tied_to_file")))
|
||||
!= m_downloadList->end())
|
||||
itr = paths.erase(itr);
|
||||
else
|
||||
itr++;
|
||||
itr++;
|
||||
|
||||
if (!paths.empty())
|
||||
for (std::vector<std::string>::iterator itr = paths.begin(); itr != paths.end(); ++itr)
|
||||
@@ -383,10 +386,10 @@ Manager::receive_hashing_changed() {
|
||||
try {
|
||||
|
||||
if ((*itr)->is_hash_checked())
|
||||
throw torrent::client_error("core::Manager::receive_hashing_changed() hash already checked.");
|
||||
throw torrent::client_error("core::Manager::receive_hashing_changed() hash already checked.");
|
||||
|
||||
if ((*itr)->is_hash_failed())
|
||||
continue;
|
||||
continue;
|
||||
|
||||
m_downloadList->open_throw(*itr);
|
||||
(*itr)->download()->hash_check();
|
||||
|
||||
Reference in New Issue
Block a user