merged in differences from release branch
This commit is contained in:
parent
ff365bc39e
commit
477d5ec238
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
release 0.9.1
|
release 0.9.1
|
||||||
|
|
||||||
|
* made the session disable file name checks within the boost.filsystem library
|
||||||
|
* fixed race condition in the sockets
|
||||||
* strings that are invalid utf-8 strings are now decoded with the
|
* strings that are invalid utf-8 strings are now decoded with the
|
||||||
local codepage on windows
|
local codepage on windows
|
||||||
* added the ability to build libtorrent both as a shared library
|
* added the ability to build libtorrent both as a shared library
|
||||||
|
|
|
@ -441,7 +441,7 @@ with the following option:</p>
|
||||||
<p>Once the configure script is run successfully, you just type <tt class="docutils literal"><span class="pre">make</span></tt> and
|
<p>Once the configure script is run successfully, you just type <tt class="docutils literal"><span class="pre">make</span></tt> and
|
||||||
libtorrent, the examples and the tests will be built.</p>
|
libtorrent, the examples and the tests will be built.</p>
|
||||||
<p>When libtorrent is built it may be a good idea to run the tests, you do this
|
<p>When libtorrent is built it may be a good idea to run the tests, you do this
|
||||||
my running <tt class="docutils literal"><span class="pre">make</span> <span class="pre">check</span></tt>.</p>
|
by running <tt class="docutils literal"><span class="pre">make</span> <span class="pre">check</span></tt>.</p>
|
||||||
<p>If you want to build a release version (without debug info, asserts and
|
<p>If you want to build a release version (without debug info, asserts and
|
||||||
invariant checks), you have to rerun the configure script and rebuild, like this:</p>
|
invariant checks), you have to rerun the configure script and rebuild, like this:</p>
|
||||||
<pre class="literal-block">
|
<pre class="literal-block">
|
||||||
|
|
|
@ -330,7 +330,7 @@ Once the configure script is run successfully, you just type ``make`` and
|
||||||
libtorrent, the examples and the tests will be built.
|
libtorrent, the examples and the tests will be built.
|
||||||
|
|
||||||
When libtorrent is built it may be a good idea to run the tests, you do this
|
When libtorrent is built it may be a good idea to run the tests, you do this
|
||||||
my running ``make check``.
|
by running ``make check``.
|
||||||
|
|
||||||
If you want to build a release version (without debug info, asserts and
|
If you want to build a release version (without debug info, asserts and
|
||||||
invariant checks), you have to rerun the configure script and rebuild, like this::
|
invariant checks), you have to rerun the configure script and rebuild, like this::
|
||||||
|
|
|
@ -63,10 +63,7 @@ void add_files(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cerr << "adding \"" << l.string() << "\"\n";
|
std::cerr << "adding \"" << l.string() << "\"\n";
|
||||||
file fi(f, file::in);
|
t.add_file(l, file_size(f));
|
||||||
fi.seek(0, file::end);
|
|
||||||
libtorrent::size_type size = fi.tell();
|
|
||||||
t.add_file(l, size);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,8 +79,6 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
path::default_name_check(no_check);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
torrent_info t;
|
torrent_info t;
|
||||||
|
|
|
@ -41,6 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <boost/function.hpp>
|
#include <boost/function.hpp>
|
||||||
#include <boost/noncopyable.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
#include <boost/cstdint.hpp>
|
#include <boost/cstdint.hpp>
|
||||||
|
#include <boost/thread/thread.hpp>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
@ -234,16 +235,19 @@ namespace libtorrent
|
||||||
|
|
||||||
void monitor_readability(boost::shared_ptr<socket> s)
|
void monitor_readability(boost::shared_ptr<socket> s)
|
||||||
{
|
{
|
||||||
|
boost::mutex::scoped_lock l(m_mutex);
|
||||||
assert(std::find(m_readable.begin(), m_readable.end(), s) == m_readable.end());
|
assert(std::find(m_readable.begin(), m_readable.end(), s) == m_readable.end());
|
||||||
m_readable.push_back(s);
|
m_readable.push_back(s);
|
||||||
}
|
}
|
||||||
void monitor_writability(boost::shared_ptr<socket> s)
|
void monitor_writability(boost::shared_ptr<socket> s)
|
||||||
{
|
{
|
||||||
|
boost::mutex::scoped_lock l(m_mutex);
|
||||||
assert(std::find(m_writable.begin(), m_writable.end(), s) == m_writable.end());
|
assert(std::find(m_writable.begin(), m_writable.end(), s) == m_writable.end());
|
||||||
m_writable.push_back(s);
|
m_writable.push_back(s);
|
||||||
}
|
}
|
||||||
void monitor_errors(boost::shared_ptr<socket> s)
|
void monitor_errors(boost::shared_ptr<socket> s)
|
||||||
{
|
{
|
||||||
|
boost::mutex::scoped_lock l(m_mutex);
|
||||||
assert(std::find(m_error.begin(), m_error.end(), s) == m_error.end());
|
assert(std::find(m_error.begin(), m_error.end(), s) == m_error.end());
|
||||||
m_error.push_back(s);
|
m_error.push_back(s);
|
||||||
}
|
}
|
||||||
|
@ -251,19 +255,27 @@ namespace libtorrent
|
||||||
void remove(boost::shared_ptr<socket> s);
|
void remove(boost::shared_ptr<socket> s);
|
||||||
|
|
||||||
void remove_writable(boost::shared_ptr<socket> s)
|
void remove_writable(boost::shared_ptr<socket> s)
|
||||||
{ m_writable.erase(std::find(m_writable.begin(), m_writable.end(), s)); }
|
{
|
||||||
|
boost::mutex::scoped_lock l(m_mutex);
|
||||||
|
m_writable.erase(std::find(m_writable.begin(), m_writable.end(), s));
|
||||||
|
}
|
||||||
|
|
||||||
void remove_readable(boost::shared_ptr<socket> s)
|
void remove_readable(boost::shared_ptr<socket> s)
|
||||||
{ m_readable.erase(std::find(m_readable.begin(), m_readable.end(), s)); }
|
{
|
||||||
|
boost::mutex::scoped_lock l(m_mutex);
|
||||||
|
m_readable.erase(std::find(m_readable.begin(), m_readable.end(), s));
|
||||||
|
}
|
||||||
|
|
||||||
bool is_writability_monitored(boost::shared_ptr<socket> s)
|
bool is_writability_monitored(boost::shared_ptr<socket> s)
|
||||||
{
|
{
|
||||||
|
boost::mutex::scoped_lock l(m_mutex);
|
||||||
return std::find(m_writable.begin(), m_writable.end(), s)
|
return std::find(m_writable.begin(), m_writable.end(), s)
|
||||||
!= m_writable.end();
|
!= m_writable.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_readability_monitored(boost::shared_ptr<socket> s)
|
bool is_readability_monitored(boost::shared_ptr<socket> s)
|
||||||
{
|
{
|
||||||
|
boost::mutex::scoped_lock l(m_mutex);
|
||||||
return std::find(m_readable.begin(), m_readable.end(), s)
|
return std::find(m_readable.begin(), m_readable.end(), s)
|
||||||
!= m_readable.end();
|
!= m_readable.end();
|
||||||
}
|
}
|
||||||
|
@ -273,10 +285,15 @@ namespace libtorrent
|
||||||
, std::vector<boost::shared_ptr<socket> >& writable
|
, std::vector<boost::shared_ptr<socket> >& writable
|
||||||
, std::vector<boost::shared_ptr<socket> >& error);
|
, std::vector<boost::shared_ptr<socket> >& error);
|
||||||
|
|
||||||
int count_read_monitors() const { return (int)m_readable.size(); }
|
int count_read_monitors() const
|
||||||
|
{
|
||||||
|
boost::mutex::scoped_lock l(m_mutex);
|
||||||
|
return (int)m_readable.size();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
mutable boost::mutex m_mutex;
|
||||||
std::vector<boost::shared_ptr<socket> > m_readable;
|
std::vector<boost::shared_ptr<socket> > m_readable;
|
||||||
std::vector<boost::shared_ptr<socket> > m_writable;
|
std::vector<boost::shared_ptr<socket> > m_writable;
|
||||||
std::vector<boost::shared_ptr<socket> > m_error;
|
std::vector<boost::shared_ptr<socket> > m_error;
|
||||||
|
|
|
@ -1142,6 +1142,9 @@ namespace libtorrent
|
||||||
, m_thread(boost::ref(m_impl))
|
, m_thread(boost::ref(m_impl))
|
||||||
, m_checker_thread(boost::ref(m_checker_impl))
|
, m_checker_thread(boost::ref(m_checker_impl))
|
||||||
{
|
{
|
||||||
|
// turn off the filename checking in boost.filesystem
|
||||||
|
using namespace boost::filesystem;
|
||||||
|
path::default_name_check(native);
|
||||||
assert(listen_port_range.first > 0);
|
assert(listen_port_range.first > 0);
|
||||||
assert(listen_port_range.first < listen_port_range.second);
|
assert(listen_port_range.first < listen_port_range.second);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
Loading…
Reference in New Issue