made some fixes mainly for the bsd-sockets. It still
doesn't work on linux.
This commit is contained in:
parent
1800e63c09
commit
a09595c634
|
@ -68,7 +68,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "libtorrent/entry.hpp"
|
#include "libtorrent/entry.hpp"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#if defined(_MSC_VER) && _MSC_VER < 1300
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
using ::isdigit;
|
using ::isdigit;
|
||||||
|
@ -226,7 +226,7 @@ namespace libtorrent
|
||||||
// ----------------------------------------------
|
// ----------------------------------------------
|
||||||
// string
|
// string
|
||||||
default:
|
default:
|
||||||
if (std::isdigit(*in))
|
if (isdigit(*in))
|
||||||
{
|
{
|
||||||
std::string len_s = read_until(in, end, ':');
|
std::string len_s = read_until(in, end, ':');
|
||||||
assert(*in == ':');
|
assert(*in == ':');
|
||||||
|
|
|
@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "libtorrent/peer.hpp"
|
#include "libtorrent/peer.hpp"
|
||||||
#include "piece_picker.hpp"
|
#include "libtorrent/piece_picker.hpp"
|
||||||
|
|
||||||
// TODO: should be able to close connections with too low bandwidth to save memory
|
// TODO: should be able to close connections with too low bandwidth to save memory
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,11 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
main_loop_thread(int listen_port, session_impl* s)
|
main_loop_thread(int listen_port, session_impl* s)
|
||||||
: m_ses(s), m_listen_port(listen_port) {}
|
: m_ses(s), m_listen_port(listen_port) {}
|
||||||
void operator()() { m_ses->run(m_listen_port); }
|
void operator()()
|
||||||
|
{
|
||||||
|
std::cout << "main thread started\n";
|
||||||
|
m_ses->run(m_listen_port);
|
||||||
|
}
|
||||||
session_impl* m_ses;
|
session_impl* m_ses;
|
||||||
int m_listen_port;
|
int m_listen_port;
|
||||||
};
|
};
|
||||||
|
|
|
@ -114,7 +114,10 @@ namespace libtorrent
|
||||||
entry::integer_type piece_size(unsigned int index) const
|
entry::integer_type piece_size(unsigned int index) const
|
||||||
{
|
{
|
||||||
if (index == num_pieces()-1)
|
if (index == num_pieces()-1)
|
||||||
return total_size() % m_piece_length;
|
{
|
||||||
|
entry::integer_type s = total_size() % m_piece_length;
|
||||||
|
return (s == 0)?m_piece_length:s;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return piece_length();
|
return piece_length();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <ios>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
|
@ -407,4 +407,5 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue