Commit Graph

545 Commits

Author SHA1 Message Date
Arvid Norberg 9152bc8712 fix to peer_connection::unchoke_compare 2008-10-15 02:18:59 +00:00
Arvid Norberg f0cd0c152c removed incorrect assert from recent check-in 2008-10-14 03:01:19 +00:00
Arvid Norberg fdadccf7a2 asserts for unchoke slot handling 2008-10-14 02:03:54 +00:00
Arvid Norberg c709cd28a8 fixes seeding behavior to avoid flipping unchoke slots back and forth too often 2008-10-14 00:57:58 +00:00
Arvid Norberg 62e365225b made some moer invariant checks count as expensive 2008-10-10 07:08:46 +00:00
Arvid Norberg b417a03877 removed unnecessary invariant check 2008-10-10 05:38:19 +00:00
Arvid Norberg 8499fd2fe2 moved some invariant checks into 'full-invariant-checks' builds 2008-10-10 05:25:55 +00:00
Arvid Norberg d06fea3d6c fix to handle 0-size piece response without asserting 2008-10-06 03:23:47 +00:00
Arvid Norberg ccd75006d4 fixed failing invariant check caused by a life-time issue in debug mode 2008-10-05 23:36:50 +00:00
Arvid Norberg 7733f74d7a fixed invariant check in peer_connection 2008-10-05 22:09:33 +00:00
Arvid Norberg 47c476dc0a include TCP handshake overhead 2008-09-26 06:10:21 +00:00
Andrew Resch 4189e0b697 add peer_info::progress 2008-09-25 20:39:06 +00:00
Arvid Norberg a3751cfcbe fixed bug in peer_connection::incoming_piece() in case blocks were skipped. Fixed warnings. 2008-09-25 20:12:53 +00:00
Arvid Norberg bb674134e3 fixed bind_port for outgoing peer connections 2008-09-25 07:40:55 +00:00
Arvid Norberg 13b343c1af added assertions that the stats is updated properly when receiving and sending bytes on peer_connections 2008-09-21 17:12:26 +00:00
Arvid Norberg f3d542fb2c fixed inconsistent upload_only and seed in some cases when running a metadata-less torrent 2008-09-19 23:02:45 +00:00
Arvid Norberg eb89269b6a update_interest fix for torrents without metadata 2008-09-19 07:14:24 +00:00
Arvid Norberg e85cb90652 fixed assert in peer_connection 2008-09-19 02:37:05 +00:00
Arvid Norberg e7df553fdd fixed race condition when calling a function that re-evaluates the interested flags on peers (such as prioritize files) right after the metadata is received, but before the connections are initialized 2008-09-18 20:17:49 +00:00
Arvid Norberg a61c1ee01d more disconnect handling for upload-only 2008-09-07 10:00:58 +00:00
Arvid Norberg 41808f8742 big change to improve piece picker. Better end-game mode. More options on which pieces to pick. 2008-09-06 21:04:57 +00:00
Arvid Norberg c7c0974d3f fixed bugs in verbose logging 2008-09-04 14:39:02 +00:00
Arvid Norberg d179280da2 fixed off-by-one error when receiving a piece which skipped a bunch of requests 2008-09-01 17:41:13 +00:00
Arvid Norberg 92ed7fb364 fixed metadata extension issues 2008-08-29 17:21:56 +00:00
Arvid Norberg 238dcea91d fixed missing 'set_error' when write failed 2008-08-26 23:10:42 +00:00
Arvid Norberg 7cdc7b2912 fixed typo 2008-08-25 21:10:13 +00:00
Arvid Norberg f407c6d24e fixed bug in piece time-out code. Fixes #388 2008-08-25 15:25:46 +00:00
Arvid Norberg 71db0f32db removed incorrect assert. Fixes #309 2008-08-21 11:54:38 +00:00
Arvid Norberg 37389e4fe4 added test to measure peak download rate and introduced performance warning alert when disk buffer limit and request limit are reached 2008-08-19 15:04:14 +00:00
Arvid Norberg 89907cdae8 fix no-metadata case to not send any other messages before the bitfield (which is sent once we have the metadata) 2008-08-16 22:07:15 +00:00
Arvid Norberg 68b61e4df6 removed redundant condition 2008-08-12 09:27:42 +00:00
Arvid Norberg c725d44ced fixed serious issue with 'disconnect redundant peers' where seeds would be disconnected while downloading 2008-08-12 08:18:05 +00:00
Arvid Norberg a8562a9f19 small optimization of expensive invariant check 2008-07-30 06:42:08 +00:00
Arvid Norberg 7607034ab6 exposed upload_only in peer_info 2008-07-19 07:57:43 +00:00
Arvid Norberg 4597de74df removed incorrect assert 2008-07-19 07:35:24 +00:00
Arvid Norberg 429a118dd2 keep track of interest more tightly. better support for upload_only 2008-07-18 10:03:42 +00:00
Arvid Norberg 5bf38323c1 removed invariant check that can get triggered in peer_connection::snub_peer 2008-07-13 08:06:24 +00:00
Arvid Norberg 1ed583011c made the invariant checks cheaper and more useful. The full invariant checks are still available as an option 2008-07-12 17:51:59 +00:00
Arvid Norberg 535aaf8182 fix to previous parole fix 2008-07-11 09:25:03 +00:00
Arvid Norberg 589e098002 fixed parole mode with timeouts and made it optional 2008-07-11 09:23:22 +00:00
Arvid Norberg 96ca475652 added redundant and failed byte counters to session 2008-07-11 07:30:04 +00:00
Arvid Norberg 680dab5a67 make 'snubbed' more sticky by only giving one request_timeout back when a new block is being received 2008-07-10 19:31:22 +00:00
Arvid Norberg 1bdb6afebd fixes to previous connection timeout check-in 2008-07-10 10:58:30 +00:00
Arvid Norberg d51bdc0ec0 rare request optimization 2008-07-09 18:01:00 +00:00
Arvid Norberg 22da6b5901 fixed bug where FAST pieces were cancelled when choking 2008-07-09 17:45:37 +00:00
Arvid Norberg 74fd7eea71 fixed alert posting typo 2008-07-09 17:40:03 +00:00
Arvid Norberg fc3bb01587 ignore zero size piece messages 2008-07-09 17:37:38 +00:00
Arvid Norberg 2d099b090f peer snubbing fix 2008-07-09 11:11:06 +00:00
Arvid Norberg 63d4e0d4a3 invariant check fix 2008-07-08 21:33:36 +00:00
Arvid Norberg 55a944c014 added a unwanted_block_alert 2008-07-08 18:41:04 +00:00
Arvid Norberg 5c749bcb3c added base class for peer_alerts and turned more alerts into peer_alerts with more information about the peer that generated it 2008-07-08 09:30:10 +00:00
Arvid Norberg 8d4bea9f95 fixed invariant check that could be triggered since peer snubbing was introduced 2008-07-08 08:13:45 +00:00
Arvid Norberg a20f1a8fa0 keeps track of the number of requests waiting in the send buffer and adjusts bandwidht priority accordingly in the bandwidth limiter 2008-07-08 00:03:08 +00:00
Arvid Norberg f7042ca84a improved piece timeout and peer snubbing logic 2008-07-07 12:04:06 +00:00
Arvid Norberg e576babbb8 changed the alerts to have categories and to be filtered with a bitmask instead of having a severity and be filtered by a severity level. 2008-07-06 12:22:56 +00:00
Arvid Norberg 66a7f98d84 fixed missing torrent error state 2008-07-02 21:27:16 +00:00
Arvid Norberg 0e1d2ede70 fix invariant-check bug in peer_connection 2008-06-30 07:58:50 +00:00
Arvid Norberg 8f1abd9dbe fix bug in previous check-in 2008-06-29 18:03:38 +00:00
Arvid Norberg 2ac5c13e6f introduced a stricter timeout on piece requests and snubbing. exposed some more data about this through the peer_info. Fixes #40 2008-06-29 09:50:42 +00:00
Arvid Norberg ae9f1e0465 fixed typo 2008-06-29 06:01:20 +00:00
Arvid Norberg d1b2cd558e moved peer time out logic to second tick 2008-06-29 05:35:48 +00:00
cg25 ff3e80c42f Removed svn:executable property from {c,h}pp files in branches/RC_0_13 and
trunk.
2008-06-25 14:15:21 +00:00
Arvid Norberg 964e8b93d0 added option to deliberately corrupt data from certain peers, to test the case when hash fails occurs 2008-06-23 15:37:24 +00:00
Arvid Norberg 6db1b54304 simplified policy and optimized case when a piece fails hash check 2008-06-22 20:28:03 +00:00
Arvid Norberg 9a8fc4f713 self connection fixes 2008-06-16 13:54:14 +00:00
Arvid Norberg 9d1e77dc88 optimized away torrent::m_have_pieces (#62) and added some documentation on bitfield. The piece picker is now constructed with the torrent, but still freed when turned into a seed 2008-06-07 02:58:28 +00:00
Arvid Norberg c883f4475c saves statistics from the last second from peer connections that are disconnected. Partly fixes #339 2008-06-03 05:21:00 +00:00
Arvid Norberg 68c31e48dc replaced vector<bool> with a custom bitfield type 2008-05-28 02:35:02 +00:00
Arvid Norberg c460704a5f streamlined class footprint by reducing padding 2008-05-19 02:52:32 +00:00
Arvid Norberg 111f5faecb upload only extension 2008-05-18 05:59:47 +00:00
Arvid Norberg 91d6099a55 fixed issue with torrents with 0 pieces. Fixes #306 2008-05-15 02:29:26 +00:00
Arvid Norberg f259e34f86 peer_connection fix for incoming connections 2008-05-12 10:10:39 +00:00
Arvid Norberg 2fbe53f880 assert fix 2008-05-12 06:31:54 +00:00
Arvid Norberg 971ead4a44 made redundant connction closing optional (defaults to on) 2008-05-12 06:25:53 +00:00
Arvid Norberg 068adcd9a9 indentation fix 2008-05-12 06:03:31 +00:00
Arvid Norberg eabe9cad2d improved plugin support 2008-05-12 03:05:27 +00:00
Arvid Norberg e09457e4ab take an estimate of the IP ACK traffic into account when rate limiting (allows setting rate limits closer to the capacity) 2008-05-05 17:08:14 +00:00
Arvid Norberg d15573ecc2 disk receive buffer cleanup 2008-05-05 06:25:22 +00:00
Arvid Norberg c7e6c04705 switched over to asio from boost-1.35 2008-05-03 16:05:42 +00:00
Arvid Norberg 441aacae32 fixed download bug affecting web seeds 2008-04-29 03:12:14 +00:00
Arvid Norberg a4b69e5b2d logging improvements 2008-04-20 17:17:58 +00:00
Arvid Norberg d4cfa126aa storage fixes 2008-04-12 22:08:07 +00:00
Arvid Norberg 42f55adcce support for country lookup through GeoIP 2008-04-11 08:46:43 +00:00
Arvid Norberg 093d912e9a receive buffer optimization. added receive_buffer_size and used_receive_buffer to peer_info. changed plugin api to make use of new disk_buffer_holder type 2008-04-10 10:03:23 +00:00
Arvid Norberg 2c77ae8307 fixed typo 2008-04-10 05:40:54 +00:00
Arvid Norberg 62daedeae0 fixed race condition when a torrent is removed while one of the connections is still in the connection queue 2008-04-09 20:12:52 +00:00
Arvid Norberg 5a6e21f484 peer_connection disconnect cleanup 2008-04-09 04:09:40 +00:00
Arvid Norberg e329403619 removed exceptions from peer_connection 2008-04-07 08:39:01 +00:00
Arvid Norberg 04a9dd77b5 assert fix 2008-04-07 08:15:31 +00:00
Arvid Norberg 35fd9aec61 msvc build fixes and warning fixes 2008-04-05 21:18:27 +00:00
Arvid Norberg 57d75e120a initial support for GeoIP (only AS mappings for now) 2008-04-05 04:53:22 +00:00
Arvid Norberg 0fcb204128 added peak rates to peer_info 2008-04-03 06:11:21 +00:00
Arvid Norberg 4161be867e removed dht ping from peer_from_tracker. in trunk: implemented a rate limited DHT ping (once a second per torrent) and space optimized the peer structure 2008-04-01 17:38:19 +00:00
Arvid Norberg 1511f2f59b removed calls to self() from inside constructors in peer connections 2008-03-31 04:46:24 +00:00
Arvid Norberg e1eadab1b4 fixed memory leak on disk io failures 2008-03-24 02:33:42 +00:00
Arvid Norberg 537f21d1b9 connection rate improvement when using a half-open connections limit 2008-03-16 10:49:47 +00:00
Arvid Norberg ab2354c9b4 small optimization to previous fix 2008-03-14 17:43:38 +00:00
Arvid Norberg 2cfbfd203f made tests build and pass in trunk. fixed issues in trunk revealed by the tests. fixed failing torrent invariant check in trunk and rc0.13 2008-03-14 10:17:27 +00:00
Arvid Norberg 8132c6aad6 added option to control TOS byte in peer traffic 2008-03-12 16:58:23 +00:00
Arvid Norberg 5173c7fe31 more invariant check in peer connection 2008-03-12 08:36:22 +00:00
Arvid Norberg a97be6937a unchoker counts bytes instead of rates 2008-03-10 03:30:01 +00:00
Arvid Norberg 35c113c0cb piece request fix + better logging of throttling 2008-02-27 20:37:41 +00:00
Arvid Norberg 333839c9b4 piece picker update 2008-02-18 03:07:14 +00:00
Arvid Norberg f1ceb44dc4 fixed assert. #271 2008-02-17 20:40:21 +00:00
Arvid Norberg cecd0dfcd2 added rtt estimation for outgoing connections 2008-02-09 22:42:56 +00:00
Arvid Norberg 8cf0510144 added disk cache for write operations 2008-02-08 10:22:05 +00:00
Arvid Norberg a53473a65d added new logging mode to log peer errors 2008-02-07 07:09:52 +00:00
Arvid Norberg 5d4d08b7ce fix problem introduced with new piece picker 2008-02-05 05:57:32 +00:00
Arvid Norberg 1c82ef36d8 improved support for out-of-memory conditions 2008-02-05 05:51:05 +00:00
Arvid Norberg c798ab30e1 rewrote the piece picker to be more cpu and memory efficient. replaces the concept of sequential-download-threshold with just a sequential download settings 2008-01-31 17:52:29 +00:00
Arvid Norberg 8b455be1d9 better exception handling and more invariant checks 2008-01-19 19:00:54 +00:00
Arvid Norberg 127d3e6ad5 bandwidth limiter fixes. proper priority that cannot starve connections 2008-01-17 17:40:46 +00:00
Arvid Norberg c69fa07e2d error handling fixes 2008-01-16 21:07:04 +00:00
Arvid Norberg b19bf337bf generalized peer read/write state 2008-01-13 23:46:43 +00:00
Arvid Norberg f48ded8a54 fast extension fix 2008-01-13 09:33:00 +00:00
Arvid Norberg 616a48b591 fix to count loopback connections as local peers 2008-01-11 05:40:19 +00:00
Arvid Norberg 471d81394d added invariant check 2008-01-10 22:44:32 +00:00
Arvid Norberg 3a727e99ff expose more info through peer_info 2008-01-10 22:13:23 +00:00
Arvid Norberg 4420473b88 made send buffer watermark configurable 2008-01-08 01:16:30 +00:00
Arvid Norberg 1d6e0f5bf6 bandwidth request block size optimization 2008-01-07 04:47:20 +00:00
Arvid Norberg 0dfb129b57 another failcount update fix 2008-01-07 04:07:31 +00:00
Arvid Norberg cf4036310b changed the way connections are disconnected. improved logging. Does not depend on exceptions anymore 2008-01-07 01:10:46 +00:00
Arvid Norberg 4271eda751 correctly increase the failcounter when appropriate 2008-01-07 00:33:20 +00:00
Arvid Norberg fcd2408f11 fast extension fix, added some logging for fast extension messages, improved test to catch the problem 2008-01-02 03:18:29 +00:00
Arvid Norberg 9d2c0e370e fixed broken assert 2007-12-31 10:11:10 +00:00
Arvid Norberg ddf16fb3bb separated bandwidth_manager into bandwidht_limit and bandwidth_queue_entry and fixed problems related to #225 2007-12-31 09:41:50 +00:00
Arvid Norberg cfe5c8962e more asserts around send buffers and fixes potential race condition 2007-12-27 21:43:11 +00:00
Arvid Norberg ba172954e6 accept have messages without having metadata and without having received a bitfield 2007-12-20 23:58:58 +00:00
Arvid Norberg 3b4cccf1dd fixed broken assert 2007-12-20 23:53:03 +00:00
Arvid Norberg d1311e2bb8 improved session logging 2007-12-19 21:36:54 +00:00
Arvid Norberg 9aa2ddec80 added a plugin 'smart_ban' that can ban peers sending bad data with higher accuracy 2007-12-18 06:04:54 +00:00
Arvid Norberg 456f8f8677 fix to bound check piece index before use in incoming_allowed_fast 2007-12-18 04:40:19 +00:00
Arvid Norberg ac28fa7b62 some more asserts related to bandwidth manager 2007-12-14 18:02:06 +00:00
Arvid Norberg 1a280e31fa cleanup. changed the connection map into a set of peer_connections. moved the policy object into the torrent (as opposed to being a pointer). Fixes issues with multiple peers on the same IP. Reduces some lookups. 2007-10-31 09:48:20 +00:00
Arvid Norberg f054ae7c2d made the handshake timeout configurable and defaults to 10 seconds 2007-10-23 00:19:28 +00:00
Arvid Norberg fcc238e801 lowered piece timeout and sends cancels for pieces when a time out occurs 2007-10-22 20:58:42 +00:00
Arvid Norberg d3bce762c5 added timeout logging in verbose logging mode 2007-10-22 04:56:09 +00:00
Arvid Norberg a00f27b7ec some extra peer logging + fix for previous invariant check 2007-10-18 04:18:09 +00:00
Arvid Norberg b032c26bf0 adds invariant check to make sure pieces that are complete are also checked. adds a debug function in the disk_io_thread. Fixes a problem with a failing disk write that would not clear the block for re-download. Adds some extra session logging 2007-10-18 00:32:16 +00:00
Arvid Norberg 1699fa4652 fast reconnect fixes 2007-10-15 05:03:29 +00:00
Arvid Norberg 28113c9c42 parole mode improvement. Doesn't clear out the request queue when choked by a peer on parole anymore 2007-10-10 02:27:55 +00:00
Arvid Norberg f5f658f8fd fast extension fixes 2007-10-05 22:45:24 +00:00
Arvid Norberg 966800cd5b replaced the assert macro to TORRENT_ASSERT instead of hi-jacking assert. 2007-10-05 00:30:00 +00:00
Arvid Norberg 2940d253c3 completed fast reconnect fix 2007-10-04 21:26:50 +00:00
Arvid Norberg d29fbdc453 added tests for fast extension features + fixes 2007-10-04 09:32:09 +00:00
Arvid Norberg 51f12e774e moved block_downloading_alert and block_finished_alert to debug level 2007-10-03 22:53:52 +00:00
Arvid Norberg c9d245e9f1 handles case where a request in the allow fast set is rejected 2007-10-03 16:57:20 +00:00
Arvid Norberg 1cbe23667b added check for valid allowed-fast messages 2007-10-01 01:12:00 +00:00
Arvid Norberg b48948e231 changed the double send buffers to a chained buffer using iovec send operations. buffers are recycled (saves memory and cpu) and memory copies are avoided (saves cpu). More statistics is added to track buffer usage 2007-09-29 16:14:03 +00:00
Arvid Norberg 3b6aee6d86 switched out std::vector to use libtorrent::buffer as an optimization 2007-09-23 00:51:45 +00:00