merged changes from RC_1_0

This commit is contained in:
Arvid Norberg 2014-11-24 04:25:05 +00:00
parent 211603b7a5
commit 29fb79f60c
3 changed files with 25 additions and 4 deletions

View File

@ -634,7 +634,8 @@ void add_torrent(libtorrent::session& ses
}
std::vector<std::string> list_dir(std::string path
, bool (*filter_fun)(std::string const&))
, bool (*filter_fun)(std::string const&)
, libtorrent::error_code& ec)
{
std::vector<std::string> ret;
#ifdef TORRENT_WINDOWS
@ -647,7 +648,10 @@ std::vector<std::string> list_dir(std::string path
WIN32_FIND_DATAW fd;
HANDLE handle = FindFirstFileW(wpath.c_str(), &fd);
if (handle == INVALID_HANDLE_VALUE)
{
ec.assign(GetLastError(), boost::system::sytem_category());
return ret;
}
do
{
@ -664,7 +668,11 @@ std::vector<std::string> list_dir(std::string path
path.resize(path.size()-1);
DIR* handle = opendir(path.c_str());
if (handle == 0) return ret;
if (handle == 0)
{
ec.assign(errno, boost::system::generic_category());
return ret;
}
struct dirent de;
dirent* dummy;
@ -676,6 +684,7 @@ std::vector<std::string> list_dir(std::string path
if (filter_fun(p))
ret.push_back(p);
}
closedir(handle);
#endif
return ret;
}
@ -708,7 +717,13 @@ void scan_dir(std::string const& dir_path
using namespace libtorrent;
error_code ec;
std::vector<std::string> ents = list_dir(dir_path, filter_fun);
std::vector<std::string> ents = list_dir(dir_path, filter_fun, ec);
if (ec)
{
fprintf(stderr, "failed to list directory: (%s : %d) %s\n"
, ec.category().name(), ec.value(), ec.message().c_str());
return;
}
for (std::vector<std::string>::iterator i = ents.begin()
, end(ents.end()); i != end; ++i)

View File

@ -71,6 +71,8 @@ namespace libtorrent
h.m_buf = tmp;
}
private:
aligned_holder(aligned_holder const&);
aligned_holder& operator=(aligned_holder const&);
char* m_buf;
};

View File

@ -15,7 +15,10 @@ def clean():
'bjam_build.*.xml'
'*.exe',
'*.pdb',
'*.pyd'
'*.pyd',
'dist',
'build',
'.libs'
]
directories = [
@ -23,6 +26,7 @@ def clean():
'test',
'.',
'tools',
'src',
os.path.join('bindings', 'python')
]