fix libtorrent crash

This commit is contained in:
Marcos Pinto 2007-08-01 06:40:15 +00:00
parent ff18a44c8d
commit 908430aae4
8 changed files with 108 additions and 52 deletions

View File

@ -166,6 +166,7 @@ namespace libtorrent
virtual std::auto_ptr<alert> clone() const virtual std::auto_ptr<alert> clone() const
{ return std::auto_ptr<alert>(new invalid_request_alert(*this)); } { return std::auto_ptr<alert>(new invalid_request_alert(*this)); }
tcp::endpoint ip; tcp::endpoint ip;
peer_request request; peer_request request;
peer_id pid; peer_id pid;

View File

@ -120,4 +120,3 @@ namespace libtorrent
#endif // TORRENT_HASHER_HPP_INCLUDED #endif // TORRENT_HASHER_HPP_INCLUDED

View File

@ -74,7 +74,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/socket_type.hpp" #include "libtorrent/socket_type.hpp"
#include "libtorrent/intrusive_ptr_base.hpp" #include "libtorrent/intrusive_ptr_base.hpp"
namespace libtorrent namespace libtorrent
{ {
class torrent; class torrent;
@ -698,9 +697,10 @@ namespace libtorrent
// a timestamp when the remote download rate // a timestamp when the remote download rate
// was last updated // was last updated
ptime m_remote_dl_update; ptime m_remote_dl_update;
// the number of bytes send to the disk-io
// thread that hasn't yet been completely written. // the number of bytes send to the disk-io
int m_outstanding_writing_bytes; // thread that hasn't yet been completely written.
int m_outstanding_writing_bytes;
#ifndef NDEBUG #ifndef NDEBUG
public: public:

View File

@ -144,6 +144,10 @@ namespace libtorrent
// approximate peer download rate // approximate peer download rate
int remote_dl_rate; int remote_dl_rate;
// number of bytes this peer has in
// the disk write queue
int pending_disk_bytes;
}; };
} }

View File

@ -251,15 +251,15 @@ namespace libtorrent
// while we have fewer pieces than this, pick // while we have fewer pieces than this, pick
// random pieces instead of rarest first. // random pieces instead of rarest first.
int initial_picker_threshold; int initial_picker_threshold;
// the maximum number of bytes a connection may have // the maximum number of bytes a connection may have
// pending in the disk write queue before its download // pending in the disk write queue before its download
// rate is being throttled. This prevents fast downloads // rate is being throttled. This prevents fast downloads
// to slow medias to allocate more and more memory // to slow medias to allocate more and more memory
// indefinitely. This should be set to at least 32 kB // indefinitely. This should be set to at least 32 kB
// to not completely disrupt normal downloads. // to not completely disrupt normal downloads.
int max_outstanding_disk_bytes_per_connection; int max_outstanding_disk_bytes_per_connection;
#ifndef TORRENT_DISABLE_DHT #ifndef TORRENT_DISABLE_DHT
// while this is true, the dht will note be used unless the // while this is true, the dht will note be used unless the
// tracker is online // tracker is online

View File

@ -13,7 +13,7 @@ kademlia/traversal_algorithm.cpp
endif endif
libtorrent_la_SOURCES = allocate_resources.cpp \ libtorrent_la_SOURCES = allocate_resources.cpp \
bandwidth_manager.cpp entry.cpp escape_string.cpp \ entry.cpp escape_string.cpp \
peer_connection.cpp bt_peer_connection.cpp web_peer_connection.cpp \ peer_connection.cpp bt_peer_connection.cpp web_peer_connection.cpp \
natpmp.cpp piece_picker.cpp policy.cpp session.cpp session_impl.cpp sha1.cpp \ natpmp.cpp piece_picker.cpp policy.cpp session.cpp session_impl.cpp sha1.cpp \
stat.cpp storage.cpp torrent.cpp torrent_handle.cpp pe_crypto.cpp \ stat.cpp storage.cpp torrent.cpp torrent_handle.cpp pe_crypto.cpp \

View File

@ -47,7 +47,10 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_namespaces.m4 \
$(top_srcdir)/m4/ax_boost_filesystem.m4 \ $(top_srcdir)/m4/ax_boost_filesystem.m4 \
$(top_srcdir)/m4/ax_boost_program_options.m4 \ $(top_srcdir)/m4/ax_boost_program_options.m4 \
$(top_srcdir)/m4/ax_boost_regex.m4 \ $(top_srcdir)/m4/ax_boost_regex.m4 \
$(top_srcdir)/m4/ax_boost_thread.m4 $(top_srcdir)/configure.in $(top_srcdir)/m4/ax_boost_thread.m4 \
$(top_srcdir)/m4/check_ssl.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4) $(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d mkinstalldirs = $(install_sh) -d
@ -65,13 +68,16 @@ libtorrent_la_DEPENDENCIES =
am__libtorrent_la_SOURCES_DIST = allocate_resources.cpp \ am__libtorrent_la_SOURCES_DIST = allocate_resources.cpp \
bandwidth_manager.cpp entry.cpp escape_string.cpp \ bandwidth_manager.cpp entry.cpp escape_string.cpp \
peer_connection.cpp bt_peer_connection.cpp \ peer_connection.cpp bt_peer_connection.cpp \
web_peer_connection.cpp piece_picker.cpp policy.cpp \ web_peer_connection.cpp natpmp.cpp piece_picker.cpp policy.cpp \
session.cpp session_impl.cpp sha1.cpp stat.cpp storage.cpp \ session.cpp session_impl.cpp sha1.cpp stat.cpp storage.cpp \
torrent.cpp torrent_handle.cpp torrent_info.cpp \ torrent.cpp torrent_handle.cpp pe_crypto.cpp torrent_info.cpp \
tracker_manager.cpp http_tracker_connection.cpp \ tracker_manager.cpp http_connection.cpp \
udp_tracker_connection.cpp alert.cpp identify_client.cpp \ http_tracker_connection.cpp udp_tracker_connection.cpp \
ip_filter.cpp file.cpp metadata_transfer.cpp logger.cpp \ alert.cpp identify_client.cpp ip_filter.cpp file.cpp \
file_pool.cpp ut_pex.cpp kademlia/closest_nodes.cpp \ metadata_transfer.cpp logger.cpp file_pool.cpp ut_pex.cpp \
lsd.cpp upnp.cpp instantiate_connection.cpp socks5_stream.cpp \
socks4_stream.cpp http_stream.cpp connection_queue.cpp \
disk_io_thread.cpp kademlia/closest_nodes.cpp \
kademlia/dht_tracker.cpp kademlia/find_data.cpp \ kademlia/dht_tracker.cpp kademlia/find_data.cpp \
kademlia/node.cpp kademlia/node_id.cpp kademlia/refresh.cpp \ kademlia/node.cpp kademlia/node_id.cpp kademlia/refresh.cpp \
kademlia/routing_table.cpp kademlia/rpc_manager.cpp \ kademlia/routing_table.cpp kademlia/rpc_manager.cpp \
@ -82,13 +88,16 @@ am__libtorrent_la_SOURCES_DIST = allocate_resources.cpp \
@USE_DHT_TRUE@ traversal_algorithm.lo @USE_DHT_TRUE@ traversal_algorithm.lo
am_libtorrent_la_OBJECTS = allocate_resources.lo bandwidth_manager.lo \ am_libtorrent_la_OBJECTS = allocate_resources.lo bandwidth_manager.lo \
entry.lo escape_string.lo peer_connection.lo \ entry.lo escape_string.lo peer_connection.lo \
bt_peer_connection.lo web_peer_connection.lo piece_picker.lo \ bt_peer_connection.lo web_peer_connection.lo natpmp.lo \
policy.lo session.lo session_impl.lo sha1.lo stat.lo \ piece_picker.lo policy.lo session.lo session_impl.lo sha1.lo \
storage.lo torrent.lo torrent_handle.lo torrent_info.lo \ stat.lo storage.lo torrent.lo torrent_handle.lo pe_crypto.lo \
tracker_manager.lo http_tracker_connection.lo \ torrent_info.lo tracker_manager.lo http_connection.lo \
udp_tracker_connection.lo alert.lo identify_client.lo \ http_tracker_connection.lo udp_tracker_connection.lo alert.lo \
ip_filter.lo file.lo metadata_transfer.lo logger.lo \ identify_client.lo ip_filter.lo file.lo metadata_transfer.lo \
file_pool.lo ut_pex.lo $(am__objects_1) logger.lo file_pool.lo ut_pex.lo lsd.lo upnp.lo \
instantiate_connection.lo socks5_stream.lo socks4_stream.lo \
http_stream.lo connection_queue.lo disk_io_thread.lo \
$(am__objects_1)
libtorrent_la_OBJECTS = $(am_libtorrent_la_OBJECTS) libtorrent_la_OBJECTS = $(am_libtorrent_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) DEFAULT_INCLUDES = -I. -I$(srcdir)
depcomp = $(SHELL) $(top_srcdir)/depcomp depcomp = $(SHELL) $(top_srcdir)/depcomp
@ -135,19 +144,21 @@ CYGPATH_W = @CYGPATH_W@
DEBUGFLAGS = @DEBUGFLAGS@ DEBUGFLAGS = @DEBUGFLAGS@
DEFS = @DEFS@ DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO = @ECHO@ DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@ ECHO_T = @ECHO_T@
EGREP = @EGREP@ EGREP = @EGREP@
EXAMPLESDIR = @EXAMPLESDIR@ EXAMPLESDIR = @EXAMPLESDIR@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
F77 = @F77@ FGREP = @FGREP@
FFLAGS = @FFLAGS@ GREP = @GREP@
HAVE_SSL = @HAVE_SSL@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
@ -155,6 +166,7 @@ LIBTOOL = @LIBTOOL@
LN_S = @LN_S@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
NM = @NM@
OBJEXT = @OBJEXT@ OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@ -167,21 +179,21 @@ PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@ PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
USE_DHT_FALSE = @USE_DHT_FALSE@ USE_DHT_FALSE = @USE_DHT_FALSE@
USE_DHT_TRUE = @USE_DHT_TRUE@ USE_DHT_TRUE = @USE_DHT_TRUE@
USE_ENCRYPTION_FALSE = @USE_ENCRYPTION_FALSE@
USE_ENCRYPTION_TRUE = @USE_ENCRYPTION_TRUE@
VERSION = @VERSION@ VERSION = @VERSION@
ZLIB = @ZLIB@ ZLIB = @ZLIB@
ZLIBDIR = @ZLIBDIR@ ZLIBDIR = @ZLIBDIR@
ZLIBINCL = @ZLIBINCL@ ZLIBINCL = @ZLIBINCL@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@ ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@ ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
acx_pthread_config = @acx_pthread_config@ acx_pthread_config = @acx_pthread_config@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
@ -199,23 +211,31 @@ build_cpu = @build_cpu@
build_os = @build_os@ build_os = @build_os@
build_vendor = @build_vendor@ build_vendor = @build_vendor@
datadir = @datadir@ datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@ exec_prefix = @exec_prefix@
host = @host@ host = @host@
host_alias = @host_alias@ host_alias = @host_alias@
host_cpu = @host_cpu@ host_cpu = @host_cpu@
host_os = @host_os@ host_os = @host_os@
host_vendor = @host_vendor@ host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@ includedir = @includedir@
infodir = @infodir@ infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@ libdir = @libdir@
libexecdir = @libexecdir@ libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@ localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@ mandir = @mandir@
mkdir_p = @mkdir_p@ mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@ oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@ prefix = @prefix@
program_transform_name = @program_transform_name@ program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@ sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@ sysconfdir = @sysconfdir@
@ -234,12 +254,15 @@ lib_LTLIBRARIES = libtorrent.la
libtorrent_la_SOURCES = allocate_resources.cpp \ libtorrent_la_SOURCES = allocate_resources.cpp \
bandwidth_manager.cpp entry.cpp escape_string.cpp \ bandwidth_manager.cpp entry.cpp escape_string.cpp \
peer_connection.cpp bt_peer_connection.cpp web_peer_connection.cpp \ peer_connection.cpp bt_peer_connection.cpp web_peer_connection.cpp \
piece_picker.cpp policy.cpp session.cpp session_impl.cpp sha1.cpp stat.cpp \ natpmp.cpp piece_picker.cpp policy.cpp session.cpp session_impl.cpp sha1.cpp \
storage.cpp torrent.cpp torrent_handle.cpp \ stat.cpp storage.cpp torrent.cpp torrent_handle.cpp pe_crypto.cpp \
torrent_info.cpp tracker_manager.cpp \ torrent_info.cpp tracker_manager.cpp http_connection.cpp \
http_tracker_connection.cpp udp_tracker_connection.cpp \ http_tracker_connection.cpp udp_tracker_connection.cpp \
alert.cpp identify_client.cpp ip_filter.cpp file.cpp metadata_transfer.cpp \ alert.cpp identify_client.cpp ip_filter.cpp file.cpp metadata_transfer.cpp \
logger.cpp file_pool.cpp ut_pex.cpp $(kademlia_sources) logger.cpp file_pool.cpp ut_pex.cpp lsd.cpp upnp.cpp instantiate_connection.cpp \
socks5_stream.cpp socks4_stream.cpp http_stream.cpp connection_queue.cpp \
disk_io_thread.cpp \
$(kademlia_sources)
noinst_HEADERS = \ noinst_HEADERS = \
$(top_srcdir)/include/libtorrent/alert.hpp \ $(top_srcdir)/include/libtorrent/alert.hpp \
@ -250,7 +273,9 @@ $(top_srcdir)/include/libtorrent/aux_/session_impl.hpp \
$(top_srcdir)/include/libtorrent/bandwidth_manager.hpp \ $(top_srcdir)/include/libtorrent/bandwidth_manager.hpp \
$(top_srcdir)/include/libtorrent/bencode.hpp \ $(top_srcdir)/include/libtorrent/bencode.hpp \
$(top_srcdir)/include/libtorrent/buffer.hpp \ $(top_srcdir)/include/libtorrent/buffer.hpp \
$(top_srcdir)/include/libtorrent/connection_queue.hpp \
$(top_srcdir)/include/libtorrent/debug.hpp \ $(top_srcdir)/include/libtorrent/debug.hpp \
$(top_srcdir)/include/libtorrent/disk_io_thread.hpp \
$(top_srcdir)/include/libtorrent/entry.hpp \ $(top_srcdir)/include/libtorrent/entry.hpp \
$(top_srcdir)/include/libtorrent/escape_string.hpp \ $(top_srcdir)/include/libtorrent/escape_string.hpp \
$(top_srcdir)/include/libtorrent/extensions.hpp \ $(top_srcdir)/include/libtorrent/extensions.hpp \
@ -261,16 +286,24 @@ $(top_srcdir)/include/libtorrent/file.hpp \
$(top_srcdir)/include/libtorrent/file_pool.hpp \ $(top_srcdir)/include/libtorrent/file_pool.hpp \
$(top_srcdir)/include/libtorrent/fingerprint.hpp \ $(top_srcdir)/include/libtorrent/fingerprint.hpp \
$(top_srcdir)/include/libtorrent/hasher.hpp \ $(top_srcdir)/include/libtorrent/hasher.hpp \
$(top_srcdir)/include/libtorrent/http_connection.hpp \
$(top_srcdir)/include/libtorrent/http_stream.hpp \
$(top_srcdir)/include/libtorrent/session_settings.hpp \ $(top_srcdir)/include/libtorrent/session_settings.hpp \
$(top_srcdir)/include/libtorrent/http_tracker_connection.hpp \ $(top_srcdir)/include/libtorrent/http_tracker_connection.hpp \
$(top_srcdir)/include/libtorrent/identify_client.hpp \ $(top_srcdir)/include/libtorrent/identify_client.hpp \
$(top_srcdir)/include/libtorrent/instantiate_connection.hpp \
$(top_srcdir)/include/libtorrent/intrusive_ptr_base.hpp \
$(top_srcdir)/include/libtorrent/invariant_check.hpp \ $(top_srcdir)/include/libtorrent/invariant_check.hpp \
$(top_srcdir)/include/libtorrent/io.hpp \ $(top_srcdir)/include/libtorrent/io.hpp \
$(top_srcdir)/include/libtorrent/ip_filter.hpp \ $(top_srcdir)/include/libtorrent/ip_filter.hpp \
$(top_srcdir)/include/libtorrent/lsd.hpp \
$(top_srcdir)/include/libtorrent/peer.hpp \ $(top_srcdir)/include/libtorrent/peer.hpp \
$(top_srcdir)/include/libtorrent/peer_connection.hpp \ $(top_srcdir)/include/libtorrent/peer_connection.hpp \
$(top_srcdir)/include/libtorrent/bt_peer_connection.hpp \ $(top_srcdir)/include/libtorrent/bt_peer_connection.hpp \
$(top_srcdir)/include/libtorrent/web_peer_connection.hpp \ $(top_srcdir)/include/libtorrent/web_peer_connection.hpp \
$(top_srcdir)/include/libtorrent/pe_crypto.hpp \
$(top_srcdir)/include/libtorrent/natpmp.hpp \
$(top_srcdir)/include/libtorrent/pch.hpp \
$(top_srcdir)/include/libtorrent/peer_id.hpp \ $(top_srcdir)/include/libtorrent/peer_id.hpp \
$(top_srcdir)/include/libtorrent/peer_info.hpp \ $(top_srcdir)/include/libtorrent/peer_info.hpp \
$(top_srcdir)/include/libtorrent/peer_request.hpp \ $(top_srcdir)/include/libtorrent/peer_request.hpp \
@ -281,17 +314,23 @@ $(top_srcdir)/include/libtorrent/resource_request.hpp \
$(top_srcdir)/include/libtorrent/session.hpp \ $(top_srcdir)/include/libtorrent/session.hpp \
$(top_srcdir)/include/libtorrent/size_type.hpp \ $(top_srcdir)/include/libtorrent/size_type.hpp \
$(top_srcdir)/include/libtorrent/socket.hpp \ $(top_srcdir)/include/libtorrent/socket.hpp \
$(top_srcdir)/include/libtorrent/socket_type.hpp \
$(top_srcdir)/include/libtorrent/socks4_stream.hpp \
$(top_srcdir)/include/libtorrent/socks5_stream.hpp \
$(top_srcdir)/include/libtorrent/stat.hpp \ $(top_srcdir)/include/libtorrent/stat.hpp \
$(top_srcdir)/include/libtorrent/storage.hpp \ $(top_srcdir)/include/libtorrent/storage.hpp \
$(top_srcdir)/include/libtorrent/time.hpp \
$(top_srcdir)/include/libtorrent/torrent.hpp \ $(top_srcdir)/include/libtorrent/torrent.hpp \
$(top_srcdir)/include/libtorrent/torrent_handle.hpp \ $(top_srcdir)/include/libtorrent/torrent_handle.hpp \
$(top_srcdir)/include/libtorrent/torrent_info.hpp \ $(top_srcdir)/include/libtorrent/torrent_info.hpp \
$(top_srcdir)/include/libtorrent/tracker_manager.hpp \ $(top_srcdir)/include/libtorrent/tracker_manager.hpp \
$(top_srcdir)/include/libtorrent/udp_tracker_connection.hpp \ $(top_srcdir)/include/libtorrent/udp_tracker_connection.hpp \
$(top_srcdir)/include/libtorrent/utf8.hpp \ $(top_srcdir)/include/libtorrent/utf8.hpp \
$(top_srcdir)/include/libtorrent/xml_parse.hpp \
$(top_srcdir)/include/libtorrent/variant_stream.hpp \
$(top_srcdir)/include/libtorrent/version.hpp $(top_srcdir)/include/libtorrent/version.hpp
libtorrent_la_LDFLAGS = $(LDFLAGS) -version-info 1:0:1 libtorrent_la_LDFLAGS = $(LDFLAGS) -release @VERSION@
libtorrent_la_LIBADD = @ZLIB@ -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@ libtorrent_la_LIBADD = @ZLIB@ -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@
AM_CXXFLAGS = -ftemplate-depth-50 -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @ZLIBINCL@ @DEBUGFLAGS@ @PTHREAD_CFLAGS@ AM_CXXFLAGS = -ftemplate-depth-50 -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @ZLIBINCL@ @DEBUGFLAGS@ @PTHREAD_CFLAGS@
AM_LDFLAGS = $(LDFLAGS) -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@ AM_LDFLAGS = $(LDFLAGS) -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@
@ -369,19 +408,27 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bandwidth_manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bandwidth_manager.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt_peer_connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt_peer_connection.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closest_nodes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closest_nodes.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection_queue.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dht_tracker.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dht_tracker.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disk_io_thread.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escape_string.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escape_string.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_pool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_pool.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/find_data.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/find_data.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_connection.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_stream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_tracker_connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_tracker_connection.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/identify_client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/identify_client.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/instantiate_connection.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip_filter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip_filter.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logger.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logger.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metadata_transfer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metadata_transfer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/natpmp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node_id.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node_id.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_crypto.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peer_connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peer_connection.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/piece_picker.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/piece_picker.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/policy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/policy.Plo@am__quote@
@ -391,6 +438,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session_impl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session_impl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socks4_stream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socks5_stream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/storage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/storage.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/torrent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/torrent.Plo@am__quote@
@ -399,6 +448,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tracker_manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tracker_manager.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/traversal_algorithm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/traversal_algorithm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/udp_tracker_connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/udp_tracker_connection.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upnp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ut_pex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ut_pex.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/web_peer_connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/web_peer_connection.Plo@am__quote@

View File

@ -190,7 +190,7 @@ namespace libtorrent
, m_remote_bytes_dled(0) , m_remote_bytes_dled(0)
, m_remote_dl_rate(0) , m_remote_dl_rate(0)
, m_remote_dl_update(time_now()) , m_remote_dl_update(time_now())
, m_outstanding_writing_bytes(0) , m_outstanding_writing_bytes(0)
#ifndef NDEBUG #ifndef NDEBUG
, m_in_constructor(true) , m_in_constructor(true)
#endif #endif
@ -1152,7 +1152,7 @@ namespace libtorrent
fs.async_write(p, data, bind(&peer_connection::on_disk_write_complete fs.async_write(p, data, bind(&peer_connection::on_disk_write_complete
, self(), _1, _2, p, t)); , self(), _1, _2, p, t));
m_outstanding_writing_bytes += p.length; m_outstanding_writing_bytes += p.length;
picker.mark_as_writing(block_finished, peer_info_struct()); picker.mark_as_writing(block_finished, peer_info_struct());
} }
@ -1161,11 +1161,12 @@ namespace libtorrent
{ {
session_impl::mutex_t::scoped_lock l(m_ses.m_mutex); session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
m_outstanding_writing_bytes -= p.length; m_outstanding_writing_bytes -= p.length;
assert(m_outstanding_writing_bytes >= 0); assert(m_outstanding_writing_bytes >= 0);
// in case the outstanding bytes just dropped down
// to allow to receive more data // in case the outstanding bytes just dropped down
setup_receive(); // to allow to receive more data
setup_receive();
if (ret == -1 || !t) if (ret == -1 || !t)
{ {
@ -1674,6 +1675,7 @@ namespace libtorrent
p.payload_up_speed = statistics().upload_payload_rate(); p.payload_up_speed = statistics().upload_payload_rate();
p.pid = pid(); p.pid = pid();
p.ip = remote(); p.ip = remote();
p.pending_disk_bytes = m_outstanding_writing_bytes;
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES #ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
p.country[0] = m_country[0]; p.country[0] = m_country[0];
@ -2347,9 +2349,7 @@ namespace libtorrent
|| !m_send_buffer[(m_current_send_buffer + 1) & 1].empty()) || !m_send_buffer[(m_current_send_buffer + 1) & 1].empty())
&& (m_bandwidth_limit[upload_channel].quota_left() > 0 && (m_bandwidth_limit[upload_channel].quota_left() > 0
|| m_ignore_bandwidth_limits) || m_ignore_bandwidth_limits)
&& !m_connecting && !m_connecting;
&& m_outstanding_writing_bytes <
m_ses.settings().max_outstanding_disk_bytes_per_connection;
} }
bool peer_connection::can_read() const bool peer_connection::can_read() const
@ -2358,7 +2358,9 @@ namespace libtorrent
return (m_bandwidth_limit[download_channel].quota_left() > 0 return (m_bandwidth_limit[download_channel].quota_left() > 0
|| m_ignore_bandwidth_limits) || m_ignore_bandwidth_limits)
&& !m_connecting; && !m_connecting
&& m_outstanding_writing_bytes <
m_ses.settings().max_outstanding_disk_bytes_per_connection;
} }
void peer_connection::connect(int ticket) void peer_connection::connect(int ticket)