Browse Source

fix compilation error (m_sent_bitfield) without libtorrent debug

miguelfreitas
Miguel Freitas 11 years ago
parent
commit
52a3ecda88
  1. 6
      TODO
  2. 2
      libtorrent/include/libtorrent/bt_peer_connection.hpp
  3. 16
      libtorrent/src/bt_peer_connection.cpp

6
TODO

@ -42,5 +42,11 @@ and can also be sure to receive all mentions. @@ -42,5 +42,11 @@ and can also be sure to receive all mentions.
- Implement hashtag "storage-less" torrents for post distribution.
- Define expiration policies to dht stored values. Currently all keys are refreshed every hour which,
according to previous bittorrent research, would be enough to keep data available forever (with high
probability). twister also persists keys to disk. As userbase increases, old post storage and
unreliable multivalued keys should better expire. Since those posts include the height and time, a
policy may me defined.
-

2
libtorrent/include/libtorrent/bt_peer_connection.hpp

@ -434,10 +434,10 @@ private: @@ -434,10 +434,10 @@ private:
boost::scoped_ptr<sha1_hash> m_sync_hash;
#endif // #ifndef TORRENT_DISABLE_ENCRYPTION
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
// this is set to true when the client's
// bitfield is sent to this peer
bool m_sent_bitfield;
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
bool m_in_constructor;

16
libtorrent/src/bt_peer_connection.cpp

@ -118,8 +118,8 @@ namespace libtorrent @@ -118,8 +118,8 @@ namespace libtorrent
, m_rc4_encrypted(false)
, m_sync_bytes_read(0)
#endif
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
, m_sent_bitfield(false)
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
, m_in_constructor(true)
, m_sent_handshake(false)
#endif
@ -227,8 +227,8 @@ namespace libtorrent @@ -227,8 +227,8 @@ namespace libtorrent
if (m_state < read_packet_size) return;
boost::shared_ptr<torrent> t = associated_torrent().lock();
TORRENT_ASSERT(t);
if(!m_sent_bitfield)
write_bitfield();
if(!m_sent_bitfield)
write_bitfield();
#ifndef TORRENT_DISABLE_DHT
if (m_supports_dht_port && m_ses.m_dht)
write_dht_port(m_ses.m_external_udp_port);
@ -254,9 +254,7 @@ namespace libtorrent @@ -254,9 +254,7 @@ namespace libtorrent
{
INVARIANT_CHECK;
TORRENT_ASSERT(m_sent_handshake && !m_sent_bitfield);
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
m_sent_bitfield = true;
#endif
#ifdef TORRENT_VERBOSE_LOGGING
peer_log("==> HAVE_ALL");
#endif
@ -268,9 +266,7 @@ namespace libtorrent @@ -268,9 +266,7 @@ namespace libtorrent
{
INVARIANT_CHECK;
TORRENT_ASSERT(m_sent_handshake && !m_sent_bitfield);
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
m_sent_bitfield = true;
#endif
#ifdef TORRENT_VERBOSE_LOGGING
peer_log("==> HAVE_NONE");
#endif
@ -1958,9 +1954,7 @@ namespace libtorrent @@ -1958,9 +1954,7 @@ namespace libtorrent
// if we are super seeding, pretend to not have any piece
// and don't send a bitfield
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
m_sent_bitfield = true;
#endif
// bootstrap superseeding by sending two have message
superseed_piece(-1, t->get_piece_to_super_seed(get_bitfield()));
@ -1985,9 +1979,7 @@ namespace libtorrent @@ -1985,9 +1979,7 @@ namespace libtorrent
#ifdef TORRENT_VERBOSE_LOGGING
peer_log(" *** NOT SENDING BITFIELD");
#endif
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
m_sent_bitfield = true;
#endif
return;
}
@ -2060,9 +2052,7 @@ namespace libtorrent @@ -2060,9 +2052,7 @@ namespace libtorrent
}
peer_log("==> BITFIELD [ %s ]", bitfield_string.c_str());
#endif
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
m_sent_bitfield = true;
#endif
send_buffer(msg, packet_size);

Loading…
Cancel
Save