*** empty log message ***

This commit is contained in:
Arvid Norberg 2004-04-17 12:29:35 +00:00
parent f297381fa5
commit 6b5b48adbc
7 changed files with 56 additions and 20 deletions

11
Jamfile
View File

@ -25,13 +25,6 @@ REQUIREMENTS =
<toolset>msvc-7.1:<cxxflags>/Zc:wchar_t
<toolset>msvc:<define>WIN32
# gcc switches
<toolset>gcc:<cxxflags>-Wno-unused-variable
# darwin switches
<toolset>darwin:<cxxflags>-Wno-unused-variable
;
USAGE_REQUIREMENTS =
@ -83,8 +76,8 @@ ZLIB_SOURCES =
if [ os.name ] = NT
{
lib winsock : : <name>wsock32.lib ;
REQUIREMENTS += <library>winsock ;
# lib wsock32 : : <name>wsock32.lib ;
REQUIREMENTS += <library>wsock32.lib ;
SOURCES += file_win.cpp ;
}
else

View File

@ -1,28 +1,29 @@
use-project /torrent : .. ;
exe client_test
: client_test.cpp
..//torrent
/torrent
:
# <threading>multi
<threading>multi
: debug release
;
exe simple_client
: simple_client.cpp
..//torrent
/torrent
:
# <threading>multi
<threading>multi
: debug release
;
exe dump_torrent
: dump_torrent.cpp
..//torrent
/torrent
:
# <threading>multi
<threading>multi
: debug release
;

View File

@ -5,7 +5,6 @@
#ifndef TORRENT_INVARIANT_ACCESS_HPP_INCLUDED
#define TORRENT_INVARIANT_ACCESS_HPP_INCLUDED
#include <iostream>
#include <cassert>
namespace libtorrent
@ -69,7 +68,9 @@ namespace libtorrent
#ifndef NDEBUG
#define INVARIANT_CHECK \
invariant_checker const& _invariant_check = make_invariant_checker(*this)
invariant_checker const& _invariant_check = make_invariant_checker(*this); \
(void)_invariant_check; \
do {} while (false)
#else
#define INVARIANT_CHECK do {} while (false)
#endif

38
include/libtorrent/version.hpp Executable file
View File

@ -0,0 +1,38 @@
/*
Copyright (c) 2003, Arvid Norberg
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef TORRENT_VERSION_HPP_INCLUDED
#define TORRENT_VERSION_HPP_INCLUDED
#define LIBTORRENT_VERSION "0.1.0.0"
#endif

View File

@ -43,6 +43,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/alert_types.hpp"
#include "libtorrent/invariant_check.hpp"
#include "libtorrent/io.hpp"
#include "libtorrent/version.hpp"
#if defined(_MSC_VER) && _MSC_VER < 1300
#define for if (false) {} else for
@ -907,7 +908,9 @@ namespace libtorrent
try
{
entry e = bdecode(m_recv_buffer.begin()+1, m_recv_buffer.end());
#ifndef NDEBUG
entry::dictionary_type& extensions = e.dict();
#endif
for (int i = 0; i < num_supported_extensions; ++i)
{
@ -1515,7 +1518,7 @@ namespace libtorrent
#ifndef NDEBUG
(*m_logger) << "sending libtorrent version\n";
#endif
int ret = m_socket->send("libtorrent version 0.1.0.0\n", 27);
m_socket->send("libtorrent version " LIBTORRENT_VERSION "\n", 27);
throw protocol_error("closing");
}
#ifndef NDEBUG

View File

@ -707,6 +707,7 @@ namespace libtorrent { namespace detail
++j)
{
torrent* p = boost::get_pointer(j->second);
assert(p);
}
#endif
if (i != m_torrents.end()) return boost::get_pointer(i->second);

View File

@ -346,8 +346,7 @@ namespace libtorrent
static_cast<int>(t->torrent_file().piece_length()) / t->block_size();
ret["blocks per piece"] = num_blocks_per_piece;
// num unfinished pieces
int num_unfinished = (int)q.size();
// unfinished pieces
ret["unfinished"] = entry::list_type();
entry::list_type& up = ret["unfinished"].list();