bandwidth_limit.hpp   bandwidth_limit.hpp 
skipping to change at line 37 skipping to change at line 37
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef TORRENT_BANDWIDTH_CHANNEL_HPP_INCLUDED #ifndef TORRENT_BANDWIDTH_CHANNEL_HPP_INCLUDED
#define TORRENT_BANDWIDTH_CHANNEL_HPP_INCLUDED #define TORRENT_BANDWIDTH_CHANNEL_HPP_INCLUDED
#include <boost/integer_traits.hpp> #include <boost/integer_traits.hpp>
#include <boost/cstdint.hpp>
#include "libtorrent/assert.hpp" #include "libtorrent/assert.hpp"
namespace libtorrent { namespace libtorrent {
// member of peer_connection // member of peer_connection
struct TORRENT_EXPORT bandwidth_channel struct TORRENT_EXPORT bandwidth_channel
{ {
static const int inf = boost::integer_traits<int>::const_max; static const int inf = boost::integer_traits<int>::const_max;
skipping to change at line 69 skipping to change at line 70
} }
int throttle() const int throttle() const
{ {
return m_limit; return m_limit;
} }
int quota_left() const int quota_left() const
{ {
if (m_limit == 0) return inf; if (m_limit == 0) return inf;
return (std::max)(m_quota_left, 0); return (std::max)(m_quota_left, boost::int64_t(0));
} }
void update_quota(int dt_milliseconds) void update_quota(int dt_milliseconds)
{ {
if (m_limit == 0) return; if (m_limit == 0) return;
m_quota_left += (m_limit * dt_milliseconds + 500) / 1000; m_quota_left += (m_limit * dt_milliseconds + 500) / 1000;
if (m_quota_left > m_limit * 3) m_quota_left = m_limit * 3; if (m_quota_left > m_limit * 3) m_quota_left = m_limit * 3;
distribute_quota = (std::max)(m_quota_left, 0); distribute_quota = (std::max)(m_quota_left, boost::int64_t(0
// fprintf(stderr, "%p: [%d]: + %d limit: %d\n", this, dt_milli ));
seconds, (m_limit * dt_milliseconds + 500) / 1000, m_limit); // fprintf(stderr, "%p: [%d]: + %"PRId64" limit: %"PRId64" quot
a_left: %"PRId64"\n", this
// , dt_milliseconds, (m_limit * dt_milliseconds + 500)
/ 1000, m_limit
// , m_quota_left);
} }
// this is used when connections disconnect with // this is used when connections disconnect with
// some quota left. It's returned to its bandwidth // some quota left. It's returned to its bandwidth
// channels. // channels.
void return_quota(int amount) void return_quota(int amount)
{ {
TORRENT_ASSERT(amount >= 0); TORRENT_ASSERT(amount >= 0);
if (m_limit == 0) return; if (m_limit == 0) return;
TORRENT_ASSERT(m_quota_left <= m_quota_left + amount); TORRENT_ASSERT(m_quota_left <= m_quota_left + amount);
m_quota_left += amount; m_quota_left += amount;
} }
void use_quota(int amount) void use_quota(int amount)
{ {
TORRENT_ASSERT(amount >= 0); TORRENT_ASSERT(amount >= 0);
TORRENT_ASSERT(m_limit >= 0); TORRENT_ASSERT(m_limit >= 0);
if (m_limit == 0) return; if (m_limit == 0) return;
// fprintf(stderr, "%p: - %"PRId64" limit: %"PRId64" quota_left
: %"PRId64"\n", this
// , amount, m_limit, m_quota_left);
m_quota_left -= amount; m_quota_left -= amount;
} }
// used as temporary storage while distributing // used as temporary storage while distributing
// bandwidth // bandwidth
int tmp; int tmp;
// this is the number of bytes to distribute this round // this is the number of bytes to distribute this round
int distribute_quota; int distribute_quota;
private: private:
// this is the amount of bandwidth we have // this is the amount of bandwidth we have
// been assigned without using yet. // been assigned without using yet.
int m_quota_left; boost::int64_t m_quota_left;
// the limit is the number of bytes // the limit is the number of bytes
// per second we are allowed to use. // per second we are allowed to use.
int m_limit; boost::int64_t m_limit;
}; };
} }
#endif #endif
 End of changes. 6 change blocks. 
6 lines changed or deleted 15 lines changed or added


 file.hpp   file.hpp 
skipping to change at line 79 skipping to change at line 79
#ifndef _XOPEN_SOURCE #ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600 #define _XOPEN_SOURCE 600
#endif #endif
#include <unistd.h> #include <unistd.h>
#include <sys/uio.h> #include <sys/uio.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#undef _FILE_OFFSET_BITS
#endif #endif
namespace libtorrent namespace libtorrent
{ {
namespace fs = boost::filesystem; namespace fs = boost::filesystem;
class TORRENT_EXPORT file: public boost::noncopyable class TORRENT_EXPORT file: public boost::noncopyable
{ {
public: public:
enum enum
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 ip_filter.hpp   ip_filter.hpp 
skipping to change at line 263 skipping to change at line 263
int access; int access;
}; };
typedef std::set<range> range_t; typedef std::set<range> range_t;
range_t m_access_list; range_t m_access_list;
}; };
} }
class TORRENT_EXPORT ip_filter struct TORRENT_EXPORT ip_filter
{ {
public:
enum access_flags enum access_flags
{ {
blocked = 1 blocked = 1
}; };
// both addresses MUST be of the same type (i.e. both must // both addresses MUST be of the same type (i.e. both must
// be either IPv4 or both must be IPv6) // be either IPv4 or both must be IPv6)
void add_rule(address first, address last, int flags); void add_rule(address first, address last, int flags);
int access(address const& addr) const; int access(address const& addr) const;
 End of changes. 2 change blocks. 
3 lines changed or deleted 1 lines changed or added


 peer_connection.hpp   peer_connection.hpp 
skipping to change at line 539 skipping to change at line 539
// upload and download channel state // upload and download channel state
// enum from peer_info::bw_state // enum from peer_info::bw_state
char m_channel_state[2]; char m_channel_state[2];
size_type uploaded_since_unchoke() const size_type uploaded_since_unchoke() const
{ return m_statistics.total_payload_upload() - m_uploaded_at _last_unchoke; } { return m_statistics.total_payload_upload() - m_uploaded_at _last_unchoke; }
size_type downloaded_since_unchoke() const size_type downloaded_since_unchoke() const
{ return m_statistics.total_payload_download() - m_downloade d_at_last_unchoke; } { return m_statistics.total_payload_download() - m_downloade d_at_last_unchoke; }
void setup_receive(); enum sync_t { read_async, read_sync };
void setup_receive(sync_t sync = read_sync);
protected: protected:
enum sync_t { read_async, read_sync };
size_t try_read(sync_t s, error_code& ec); size_t try_read(sync_t s, error_code& ec);
virtual void get_specific_peer_info(peer_info& p) const = 0; virtual void get_specific_peer_info(peer_info& p) const = 0;
virtual void write_choke() = 0; virtual void write_choke() = 0;
virtual void write_unchoke() = 0; virtual void write_unchoke() = 0;
virtual void write_interested() = 0; virtual void write_interested() = 0;
virtual void write_not_interested() = 0; virtual void write_not_interested() = 0;
virtual void write_request(peer_request const& r) = 0; virtual void write_request(peer_request const& r) = 0;
virtual void write_cancel(peer_request const& r) = 0; virtual void write_cancel(peer_request const& r) = 0;
skipping to change at line 932 skipping to change at line 932
boost::uint8_t m_desired_queue_size; boost::uint8_t m_desired_queue_size;
// the number of piece requests we have rejected // the number of piece requests we have rejected
// in a row because the peer is choked. This is // in a row because the peer is choked. This is
// used to re-send the choked message in case the // used to re-send the choked message in case the
// other end keeps requesting pieces while being // other end keeps requesting pieces while being
// choked, and eventuelly disconnect if it keeps // choked, and eventuelly disconnect if it keeps
// requesting too many pieces while being choked // requesting too many pieces while being choked
boost::uint8_t m_choke_rejects; boost::uint8_t m_choke_rejects;
// counts the number of recursive calls to on_receive_data
// used to limit recursion
boost::uint8_t m_read_recurse:5;
// if this is true, the disconnection // if this is true, the disconnection
// timestamp is not updated when the connection // timestamp is not updated when the connection
// is closed. This means the time until we can // is closed. This means the time until we can
// reconnect to this peer is shorter, and likely // reconnect to this peer is shorter, and likely
// immediate. // immediate.
bool m_fast_reconnect:1; bool m_fast_reconnect:1;
// is true if it was we that connected to the peer // is true if it was we that connected to the peer
// and false if we got an incoming connection // and false if we got an incoming connection
// could be considered: true = local, false = remote // could be considered: true = local, false = remote
 End of changes. 3 change blocks. 
2 lines changed or deleted 6 lines changed or added


 session.hpp   session.hpp 
skipping to change at line 72 skipping to change at line 72
#include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/cat.hpp>
#ifdef _MSC_VER #ifdef _MSC_VER
# include <eh.h> # include <eh.h>
#endif #endif
namespace libtorrent namespace libtorrent
{ {
struct torrent_plugin; struct torrent_plugin;
class torrent; class torrent;
class ip_filter; struct ip_filter;
class port_filter; class port_filter;
class connection_queue; class connection_queue;
class natpmp; class natpmp;
class upnp; class upnp;
class alert; class alert;
// this is used to create linker errors when trying to link to // this is used to create linker errors when trying to link to
// a library with a conflicting build configuration than the applica tion // a library with a conflicting build configuration than the applica tion
#ifdef TORRENT_DEBUG #ifdef TORRENT_DEBUG
#define G _release #define G _release
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 torrent_info.hpp   torrent_info.hpp 
skipping to change at line 165 skipping to change at line 165
updating = false; updating = false;
} }
bool will_announce(ptime now) const bool will_announce(ptime now) const
{ {
return now <= next_announce return now <= next_announce
&& (fails < fail_limit || fail_limit == 0) && (fails < fail_limit || fail_limit == 0)
&& !updating; && !updating;
} }
bool can_announce(ptime now) const bool can_announce(ptime now, bool is_seed) const;
{
return now >= next_announce
&& now >= min_announce
&& (fails < fail_limit || fail_limit == 0)
&& !updating;
}
bool is_working() const bool is_working() const
{ {
return fails == 0; return fails == 0;
} }
void trim() void trim()
{ {
while (!url.empty() && is_space(url[0])) while (!url.empty() && is_space(url[0]))
url.erase(url.begin()); url.erase(url.begin());
 End of changes. 1 change blocks. 
7 lines changed or deleted 1 lines changed or added


 udp_socket.hpp   udp_socket.hpp 
skipping to change at line 40 skipping to change at line 40
*/ */
#ifndef TORRENT_UDP_SOCKET_HPP_INCLUDED #ifndef TORRENT_UDP_SOCKET_HPP_INCLUDED
#define TORRENT_UDP_SOCKET_HPP_INCLUDED #define TORRENT_UDP_SOCKET_HPP_INCLUDED
#include "libtorrent/socket.hpp" #include "libtorrent/socket.hpp"
#include "libtorrent/session_settings.hpp" #include "libtorrent/session_settings.hpp"
#include "libtorrent/buffer.hpp" #include "libtorrent/buffer.hpp"
#include <vector> #include <list>
#include <boost/function.hpp> #include <boost/function.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
namespace libtorrent namespace libtorrent
{ {
class connection_queue; class connection_queue;
class udp_socket class udp_socket
{ {
public: public:
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 version.hpp   version.hpp 
skipping to change at line 38 skipping to change at line 38
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef TORRENT_VERSION_HPP_INCLUDED #ifndef TORRENT_VERSION_HPP_INCLUDED
#define TORRENT_VERSION_HPP_INCLUDED #define TORRENT_VERSION_HPP_INCLUDED
#define LIBTORRENT_VERSION_MAJOR 0 #define LIBTORRENT_VERSION_MAJOR 0
#define LIBTORRENT_VERSION_MINOR 15 #define LIBTORRENT_VERSION_MINOR 15
#define LIBTORRENT_VERSION_TINY 2 #define LIBTORRENT_VERSION_TINY 3
#define LIBTORRENT_VERSION "0.15.2.0" #define LIBTORRENT_VERSION "0.15.3.0"
#define LIBTORRENT_REVISION "$Rev: 4758 $" #define LIBTORRENT_REVISION "$Rev: 4826 $"
#endif #endif
 End of changes. 2 change blocks. 
3 lines changed or deleted 3 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/