merged fixes from RC_0_16

This commit is contained in:
Arvid Norberg 2012-06-09 04:48:53 +00:00
parent 74ed648894
commit fa1c071c2f
5 changed files with 13 additions and 8 deletions

View File

@ -110,7 +110,7 @@ option(exceptions "build with exception support" ON)
option(logging "build with logging" OFF)
option(verbose-logging "build with verbose logging" OFF)
option(build_tests "build tests" OFF)
option(build_examples "build examples" OFF)
option(build_examples "build examples" ON)
set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo)
@ -163,7 +163,7 @@ include_directories(${Boost_INCLUDE_DIR})
target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES})
# this works around a bug in asio in boost-1.39
add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_ASIO_DYN_LINK)
add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_ASIO_DYN_LINK -D__USE_W32_SOCKETS -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0500)
if (WIN32)
target_link_libraries(torrent-rasterbar wsock32 ws2_32)

View File

@ -1140,7 +1140,9 @@ int main(int argc, char* argv[])
" -Q enables share mode. Share mode attempts to maximize\n"
" share ratio rather than downloading\n"
" -r <IP:port> connect to specified peer\n"
#ifndef TORRENT_DISABLE_ENCRYPTION
" -e force encrypted bittorrent connections\n"
#endif
"\n QUEING OPTIONS\n"
" -v <limit> Set the max number of active downloads\n"
" -^ <limit> Set the max number of active seeds\n"
@ -1308,6 +1310,7 @@ int main(int argc, char* argv[])
case 'F': refresh_delay = atoi(arg); break;
case 'H': start_dht = false; --i; break;
case 'l': settings.listen_queue_size = atoi(arg); break;
#ifndef TORRENT_DISABLE_ENCRYPTION
case 'e':
{
pe_settings s;
@ -1319,6 +1322,7 @@ int main(int argc, char* argv[])
ses.set_pe_settings(s);
break;
}
#endif
case 'W':
settings.max_peerlist_size = atoi(arg);
settings.max_paused_peerlist_size = atoi(arg) / 2;

View File

@ -42,7 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent
{
TORRENT_EXTRA_EXPORT boost::array<char, 3 + std::numeric_limits<size_type>::digits10> to_string(size_type n);
TORRENT_EXTRA_EXPORT boost::array<char, 4 + std::numeric_limits<size_type>::digits10> to_string(size_type n);
TORRENT_EXTRA_EXPORT bool is_alpha(char c);
TORRENT_EXPORT bool is_digit(char c);
TORRENT_EXTRA_EXPORT bool is_print(char c);

View File

@ -68,9 +68,9 @@ namespace libtorrent
// lexical_cast's result depends on the locale. We need
// a well defined result
boost::array<char, 3 + std::numeric_limits<size_type>::digits10> to_string(size_type n)
boost::array<char, 4 + std::numeric_limits<size_type>::digits10> to_string(size_type n)
{
boost::array<char, 3 + std::numeric_limits<size_type>::digits10> ret;
boost::array<char, 4 + std::numeric_limits<size_type>::digits10> ret;
char *p = &ret.back();
*p = '\0';
unsigned_size_type un = n;
@ -576,7 +576,7 @@ namespace libtorrent
for (const char* i = &s[0]; i < end;)
{
wchar_t c = '.';
int result = std::mbtowc(&c, i, end - i);
result = std::mbtowc(&c, i, end - i);
if (result > 0) i += result;
else ++i;
ret += c;
@ -596,7 +596,7 @@ namespace libtorrent
{
char c[10];
TORRENT_ASSERT(sizeof(c) >= MB_CUR_MAX);
int result = std::wctomb(c, *i);
result = std::wctomb(c, *i);
if (result > 0)
{
i += result;

View File

@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/session.hpp"
#include "libtorrent/torrent_handle.hpp"
#include "libtorrent/escape_string.hpp"
#include "libtorrent/error_code.hpp"
#include <string>
@ -95,8 +96,8 @@ namespace libtorrent
return ret;
}
#ifndef TORRENT_NO_DEPRECATE
#ifndef BOOST_NO_EXCEPTIONS
#ifndef TORRENT_NO_DEPRECATE
torrent_handle add_magnet_uri(session& ses, std::string const& uri
, std::string const& save_path
, storage_mode_t storage_mode