keep track of interest more tightly. better support for upload_only

This commit is contained in:
Arvid Norberg
2008-07-18 10:03:42 +00:00
parent 84406e2064
commit 429a118dd2
5 changed files with 134 additions and 88 deletions

View File

@@ -323,6 +323,10 @@ namespace libtorrent
// the number of bytes transferred within unchoke cycles
void reset_choke_counters();
// if this peer connection is useless (neither party is
// interested in the other), disconnect it
void disconnect_if_redundant();
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
boost::shared_ptr<logger> m_logger;
#endif
@@ -854,9 +858,13 @@ namespace libtorrent
// is set to 1
bool m_snubbed:1;
// this is set to true once the bitfield is received
bool m_bitfield_received:1;
#ifndef NDEBUG
public:
bool m_in_constructor:1;
bool m_disconnect_started:1;
#endif
};
}

View File

@@ -610,6 +610,8 @@ namespace libtorrent
{ return m_connections_initialized; }
bool valid_metadata() const
{ return m_torrent_file->is_valid(); }
bool are_files_checked() const
{ return m_files_checked; }
// parses the info section from the given
// bencoded tree and moves the torrent