merged in differences from release branch

This commit is contained in:
Arvid Norberg 2005-11-18 01:12:21 +00:00
parent ff365bc39e
commit 477d5ec238
6 changed files with 29 additions and 12 deletions

View File

@ -3,8 +3,10 @@
* added the ability to limit the number of simultaneous half-open
TCP connections. Flags in peer_info has been added.
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
local codepage on windows
* added the ability to build libtorrent both as a shared library

View File

@ -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
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
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
invariant checks), you have to rerun the configure script and rebuild, like this:</p>
<pre class="literal-block">

View File

@ -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.
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
invariant checks), you have to rerun the configure script and rebuild, like this::

View File

@ -63,10 +63,7 @@ void add_files(
else
{
std::cerr << "adding \"" << l.string() << "\"\n";
file fi(f, file::in);
fi.seek(0, file::end);
libtorrent::size_type size = fi.tell();
t.add_file(l, size);
t.add_file(l, file_size(f));
}
}
@ -82,8 +79,6 @@ int main(int argc, char* argv[])
return 1;
}
path::default_name_check(no_check);
try
{
torrent_info t;

View File

@ -41,6 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/function.hpp>
#include <boost/noncopyable.hpp>
#include <boost/cstdint.hpp>
#include <boost/thread/thread.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
@ -234,16 +235,19 @@ namespace libtorrent
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());
m_readable.push_back(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());
m_writable.push_back(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());
m_error.push_back(s);
}
@ -251,19 +255,27 @@ namespace libtorrent
void remove(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)
{ 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)
{
boost::mutex::scoped_lock l(m_mutex);
return std::find(m_writable.begin(), m_writable.end(), s)
!= m_writable.end();
}
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)
!= m_readable.end();
}
@ -273,10 +285,15 @@ namespace libtorrent
, std::vector<boost::shared_ptr<socket> >& writable
, 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:
mutable boost::mutex m_mutex;
std::vector<boost::shared_ptr<socket> > m_readable;
std::vector<boost::shared_ptr<socket> > m_writable;
std::vector<boost::shared_ptr<socket> > m_error;

View File

@ -1142,6 +1142,9 @@ namespace libtorrent
, m_thread(boost::ref(m_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 < listen_port_range.second);
#ifndef NDEBUG