Commit Graph

891 Commits

Author SHA1 Message Date
Charles Kerr c75f49bc26 * add a per-peer request queue to hold the next 10-15 seconds' worth of requests so that we always have more requests at hand when the current requests start to run low.
* increase the tracker `numwant' variable to grow our peer pool
* bugfixes in cancelling requests.
* make the debug log sexy and readable like uTorrent's ;)
2007-10-06 18:20:52 +00:00
Charles Kerr 6d5182af60 fix potential "recheck torrent" deadlock 2007-10-06 01:43:04 +00:00
Charles Kerr 3a6985195d removed an assertion that depended on valid input from a peer in order to be true. 2007-10-05 05:53:00 +00:00
Charles Kerr b6483cbf3f don't allow duplicate requests to the same peer, even during endgame. (alus) 2007-10-05 00:16:47 +00:00
Charles Kerr 17743d8d04 tweak the `start torrent' code based on feedback from BentMyWookie 2007-10-04 23:47:49 +00:00
Charles Kerr 80979e0240 a little code simplification -- remove unnecessary branches 2007-10-04 20:49:37 +00:00
Charles Kerr 0872b4f40a fix the crash reported by Waldorf and John_Clay 2007-10-04 20:31:19 +00:00
Charles Kerr 53aef0a48c Simplify the tracker/pause/close/recheck/start code. 2007-10-04 19:58:30 +00:00
Charles Kerr 0938cb88d4 dead code removal 2007-10-03 21:03:40 +00:00
Charles Kerr 5f2bd1d950 speed improvements... this is getting me 700 KiB/s (which is near to my speed cap) in the ubuntu torrent test 2007-10-03 19:00:51 +00:00
Charles Kerr 877e2bb86e some more peer tweaks 2007-10-03 18:19:51 +00:00
Charles Kerr a3d1a254d1 minor source code cleanup... 2007-10-03 16:42:43 +00:00
Charles Kerr 3d2e3cfdfb add pass subscription info into the peer-msgs constructor so that we can start getting information immediately 2007-10-03 04:04:34 +00:00
Charles Kerr 0f550043fd fix peer-mgr.c:1092 asset failure reported by Waldorf_ 2007-10-03 02:46:15 +00:00
Charles Kerr 1f1605986c tear out some now-exterraneous code. 2007-10-02 20:55:14 +00:00
Charles Kerr f4988a3f6e tweak the peer manager code a little more. 2007-10-02 19:54:14 +00:00
Charles Kerr 3dbaa7d673 make the peer manager a little greedier w.r.t. keeping connections alive. 2007-10-02 19:25:18 +00:00
Charles Kerr f4901211ca Fix erratic `(int)EVBUFFER_LENGTH( inbuf ) >= byteCount' error 2007-10-02 16:59:56 +00:00
Charles Kerr cdabb1c0b1 clean up the shutdown code a little bit. 2007-10-02 16:12:44 +00:00
Charles Kerr c271cec6a3 work around portability glitch in libevent's headers 2007-10-02 14:58:39 +00:00
Charles Kerr f237bf7047 * simplify the the choking intervals
* fix peer-mgr destructor bug
* send debugging messagese to TR_DEBUG_FD instead of the console
2007-10-02 14:35:02 +00:00
Charles Kerr 77d7cf76a1 fix looong-standing potential dangling pointer bug reported by BMW 2007-10-02 03:33:17 +00:00
Charles Kerr 6ed2d25af7 threads. gotta love 'em. 2007-10-02 02:59:07 +00:00
Charles Kerr af686b3297 roll back a bug introduced in r3265 2007-10-02 02:01:57 +00:00
Charles Kerr 84ab0092fb some cleanup... remove some dead/obsolete code 2007-10-02 00:05:40 +00:00
Charles Kerr b84305cdf3 more agressive purging of connections that give socket errors 2007-10-01 18:09:59 +00:00
Charles Kerr 4ebe0b563a throttle back how many concurrent connections we make. 2007-10-01 17:51:07 +00:00
Charles Kerr f0562f5947 try to disconnect all the peers when the user hits `pause' 2007-10-01 16:50:51 +00:00
Charles Kerr 75ff12faba don't log BT protocol messages in UL/DL speed -- only log piece data transfers. 2007-10-01 16:31:17 +00:00
Charles Kerr e4fec9eefd add tr_stat.peersKnown to indicate how many peers exist in the peer `pool' 2007-10-01 15:51:54 +00:00
Charles Kerr cba61802cf remove newly-unused field tr_peer_stat::isConnected 2007-10-01 15:41:42 +00:00
Charles Kerr 1a012b8b87 maybe fix the where-are-the-peers-coming-from bug reported by SoftwareElves, John_Clay, and jahpraiseherb 2007-10-01 15:36:31 +00:00
Charles Kerr 5c11c58113 simplify libT locks now that it's (more-or-less) single-threaded. fix deadlocks. make tr_locks nestable. 2007-10-01 15:17:15 +00:00
Charles Kerr f7e3f85e50 follow BT `best practices' more closely w.r.t. choosing which pieces to download 2007-10-01 14:24:22 +00:00
Charles Kerr 60a983d845 fix bizarre libevent contortion that made valgrind cry 2007-10-01 05:49:23 +00:00
Charles Kerr 9a3c91cad2 ensure TR_PEER_FROM_INCOMING peers get peer atoms. this should fix BentMyWookie's crash. 2007-10-01 05:32:34 +00:00
Charles Kerr 56738f065c fix some memory issues. 2007-10-01 04:12:24 +00:00
Mitchell Livingston 0888fe4f68 remove unneeded line 2007-10-01 03:28:49 +00:00
Charles Kerr b99084e638 more experimenting with how to get good peers 2007-10-01 03:24:52 +00:00
Mitchell Livingston a223b7d6ea fix Bitlet and add new Limewire client id's 2007-10-01 02:50:51 +00:00
Charles Kerr 6bef7def52 tweaks 2007-10-01 00:08:12 +00:00
Charles Kerr 7cc6771318 experimental better peer management. 2007-09-30 23:55:49 +00:00
Mitchell Livingston 3e87e07e0c add bitlet to client id's 2007-09-30 13:16:18 +00:00
Charles Kerr 4c990b2a7d fix tracker crash reported by bmw 2007-09-29 15:05:20 +00:00
Charles Kerr dad333ceec more work on the locks 2007-09-29 14:55:30 +00:00
Charles Kerr b3d6391413 test to see if the new locking code can fix the old `stop' bug 2007-09-29 14:25:52 +00:00
Charles Kerr 8a40a15b16 more work on the peer-mgr locks 2007-09-29 14:19:23 +00:00
Charles Kerr 64239a21e1 prevent a deadlock via the handshake code 2007-09-29 13:47:15 +00:00
Charles Kerr 0812087a4e add mutex locks for thread safety. 2007-09-29 06:37:03 +00:00
Charles Kerr 04f6847004 take out the `thawing out' console messages 2007-09-29 00:47:33 +00:00
Charles Kerr 3f1d888354 improved uTorrent handshaking, after talking to #utorrent-dev about minutae... 2007-09-29 00:46:41 +00:00
Charles Kerr 79973a8a93 commit the next step of tiennou's fastpeers code. 2007-09-28 16:40:21 +00:00
Charles Kerr 198d2c256e fix John_Clay's tracker assertion failure. 2007-09-28 16:14:19 +00:00
Charles Kerr 92923a0236 remove obsolete MAX_PEERS in internal.h 2007-09-28 16:00:43 +00:00
Charles Kerr d9af0ff829 add more assertion tests to try to hunt down the tracker.c bug reported by John_Clay 2007-09-28 15:05:42 +00:00
Charles Kerr f0c9f9a99a add a callback to notify clients when a torrent's state changes 2007-09-28 14:51:34 +00:00
Charles Kerr c28a94d04c fix a couple of memory corruption errors while trying to track down tiennou's report on peer-msgs.c:pulse() -> inout.c:163 assertion failure. 2007-09-28 14:27:56 +00:00
Charles Kerr 2ae95a4096 fix win32 initialization bug reported by |ub0 2007-09-27 17:25:27 +00:00
Charles Kerr 1c1ef83a65 better support of the MSE protocol w.r.t. PadC and PadD 2007-09-27 14:43:33 +00:00
Charles Kerr d3077bbce1 round 2 of minor revisions to tr_stat 2007-09-27 03:30:22 +00:00
Charles Kerr 439c1f38c1 some experimental code. (1) try to improve throughput to peers. (2) add first draft of new tr_stat fields requested by BentMyWookie (3) raise the per-torrent peer limit to 100 to match LibTorrent's defaults 2007-09-27 03:03:38 +00:00
Charles Kerr d386617da2 only send a peer keepalive messages when we're not sending them anything else 2007-09-26 17:34:33 +00:00
Charles Kerr 773fa8f1f6 for every connected peer, send a keepalive message every 90 seconds 2007-09-26 15:14:37 +00:00
Charles Kerr 7ccab9de2c peer i/o cleanup 2007-09-26 14:42:03 +00:00
Charles Kerr 682be6b12e don't bother remembering peers that hang up on us.
don't bother remembering peers that are seeds when we're seeding.
2007-09-26 04:44:54 +00:00
Charles Kerr f20358927b lots of handshake fixes. incoming connections work now, both encrypted & plaintext. yay! 2007-09-26 03:52:30 +00:00
Charles Kerr b63a505c6d fix a handshake bug and reduce the idle cpu load a little. 2007-09-26 02:29:49 +00:00
Charles Kerr ee6a0b8945 modify the tr_stat struct as hashed out by charles_ and BentMyWookie. sync gtk, ipc, and wx clients. 2007-09-26 01:55:04 +00:00
Charles Kerr c6fdad0514 accept erdgeist's suggestion of using ensureMinimumFileSize() only on WIN32 -- on posix, seek+write is enough. 2007-09-25 23:21:00 +00:00
Charles Kerr fef89a3bc7 * record the ports of incoming sockets. we might need them later if we want to disconnect and reconnect.
* for portability, use libevent API for some socket upkeep
2007-09-25 23:10:34 +00:00
Charles Kerr 904359a049 * fix oops from last checkin
* remove some unused fields from internal structures
2007-09-25 22:37:23 +00:00
Charles Kerr 73522af17c fix peer-msgs.c assertion failure. (tbo) 2007-09-25 22:30:41 +00:00
Charles Kerr 7a15abaf7a better handling of tracker error messages. 2007-09-25 18:39:58 +00:00
Charles Kerr dcfe4f9802 if we connect to a peer that understands the encryption handshake, try harder to continue the connection in encrypted mode. 2007-09-25 17:56:46 +00:00
Charles Kerr 5aecf680f0 when a peer tells us that it's switched listening ports, remember the new port for the next time we connect. 2007-09-25 17:44:50 +00:00
Charles Kerr dd8dc4d87e tweak the bitfield code to be a little faster. 2007-09-25 17:43:39 +00:00
Charles Kerr 1d1a23508b * follow the BT spec more closely by disallowing peers to request blocks of more than 16KiB from us.
* don't register the choke and connection timers for torrents that aren't running.  It doesn't hurt anything but does waste a few cycles.
2007-09-25 00:04:29 +00:00
Charles Kerr 6c8d9d42d3 fixed tracker bug reported by TooMuchTime of OiNK fame 2007-09-24 20:27:20 +00:00
Charles Kerr 7caf9550df shut up some more console messages 2007-09-24 19:12:52 +00:00
Charles Kerr dd6f87a5eb fix race condition in the torrent rechecker. 2007-09-24 17:47:15 +00:00
Charles Kerr 6897fe4327 plug some minor memory leaks. (valgrind) 2007-09-24 15:50:59 +00:00
Charles Kerr b402687c93 * add sanity checks to incoming piece data requests. This may solve the inout.c:99 assertion failure.
* rename the gtk client from `transmission-gtk' to `transmission' for parity with the mac client.
2007-09-23 23:38:39 +00:00
Charles Kerr 4834dc4b13 fix crash-on-shutdown 2007-09-23 19:24:06 +00:00
Charles Kerr b3fde0b43b tweak responsivenes on switching between `uploading' and `downloading' when a user changes a file's do-not-download state 2007-09-23 14:17:39 +00:00
Charles Kerr d27c9c5034 * update tor->activityDate whenever piece data is transferred. 2007-09-23 14:12:17 +00:00
Charles Kerr 89da2294b1 * when a torrent's done downloading, have it switch to seeding mode.
* tweak the gtk+ client's torrent inspector's display of transfer rates
2007-09-23 13:53:44 +00:00
Charles Kerr 968868debe fix bug that tended to disconnect from valid peers when we were seeding. also, follow the BT spec's terminology a little closer. 2007-09-23 02:19:59 +00:00
Charles Kerr 7a54e88d4e fix bug #342 -- some hash checks were incorrectly failing, which caused the `bytes downloaded' field to appear to jump back and forth 2007-09-23 02:11:53 +00:00
Charles Kerr d8d46517b9 fix a couple of encryption bugs. 2007-09-22 21:48:02 +00:00
Charles Kerr 3c73a86595 tweak some more. follow BentMyWookie's suggestion for raising the connection limits. 2007-09-22 14:42:15 +00:00
Charles Kerr a33a033b9b tweak the peer mgr 2007-09-22 14:32:02 +00:00
Charles Kerr 10b8326f1d add a peer connection manager s.t. have a consistent way of disconnecting from bad peers, connecting to new potential peers, disconnecting from seeds when we're seeding, etc. 2007-09-22 14:18:52 +00:00
Charles Kerr ea7513e59d undo commit that accidentally checked in testing code that only allowed connections from encrypted peers 2007-09-22 05:40:33 +00:00
Charles Kerr c6aa57f306 make download speed limits work? 2007-09-22 05:16:32 +00:00
Charles Kerr 87f53cba5b maybe get speed limits working. 2007-09-22 04:44:50 +00:00
Charles Kerr ebc612d725 get encrypted uTorrent working. 2007-09-22 03:37:37 +00:00
Charles Kerr f724cdd304 * abort connections if the peer selects an encryption option we didn't offer them.
* fix a shutdown crash as a result of peer-mgr timers not getting destroyed.
* remove some console messages.
2007-09-22 00:53:11 +00:00
Charles Kerr a903f07058 fix logic error in handshake that allowed unencrypted peers even when "ignore unencrypted peers" is checked 2007-09-22 00:36:37 +00:00
Charles Kerr 56b0e5d1ac * remove some console messages.
* scrape sooner when peers are added.
* added stub code for the connection manager code
2007-09-22 00:22:10 +00:00
Charles Kerr 4b46430731 give waldorf a different assertion to crash on. 2007-09-21 15:31:46 +00:00
Charles Kerr 980a7bda9a fix stat bug reported by BentMyWookie 2007-09-21 15:13:23 +00:00
Charles Kerr e9ed5e28d9 * accept tiennou's partial patch for `fast peers' extension
* fix growl problem I introduced in the last checkin, reported by chrissturm
2007-09-21 14:50:29 +00:00
Charles Kerr 9248143ce8 fix recursive crash when stopping a torrent, reported by plantain. silence a few more console messages. 2007-09-21 14:20:55 +00:00
Charles Kerr 54c84d0b30 silence a few more console messages 2007-09-21 13:52:42 +00:00
Charles Kerr 4d15bbdc2a slightly less broken handling of cases where we can't bind to our listening port. 2007-09-21 05:31:29 +00:00
Charles Kerr 6479ecbcf6 fix crash reported by Gimp_, John_Clay, and persept_ 2007-09-21 04:41:44 +00:00
Charles Kerr 28bcf6204b clamp down on the flood of debug messages. 2007-09-20 23:33:46 +00:00
Charles Kerr 379beed969 if we're seeding, disconnect from other seeds (part 1 of 2) 2007-09-20 23:07:36 +00:00
Charles Kerr fb70a9cca0 remove the backwards compatability typedefs at BentMyWookie's suggestion. update libT, gtk, daemon, and cli accordingly... 2007-09-20 20:14:13 +00:00
Charles Kerr ad71027cbb fix small merge wart 2007-09-20 16:44:37 +00:00
Mitchell Livingston 76da1185ca merge encryption branch to trunk (xcode project is still out of date) 2007-09-20 16:32:01 +00:00
Charles Kerr d996b96e65 in WIN32, #define lseek _lseeki64 2007-09-09 01:32:59 +00:00
Charles Kerr b0505157a4 (0.8x) take denis_' suggestion for improving the peer debug message 2007-09-09 00:45:08 +00:00
Charles Kerr 4b980c4c36 (trunk) fix a nasty width truncation bug, reported by Eric in http://transmission.m0k.org/forum/viewtopic.php?t=2304&start=16 2007-09-06 16:28:24 +00:00
Charles Kerr 3cd185747c fix cut-and-paste bug 2007-09-05 23:58:35 +00:00
Charles Kerr b1c9a9bd97 (trunk) fix some of the crash-on-shutdown issues. 2007-09-05 23:01:56 +00:00
Charles Kerr 7be8b8d116 (trunk) better fix for previous commit 2007-09-01 02:56:48 +00:00
Charles Kerr eeb5cc6b5e (trunk) Fix hash-checking error. Thanks to denis for tracking it down and submitting a patch. 2007-09-01 02:46:04 +00:00
Josh Elsasser d422d6dbc7 Enable the azureus/libtorrent extension negotiation reserved bits. 2007-08-26 16:16:41 +00:00
Charles Kerr 53d48e4c37 add utility function for setting libevent timer intervals 2007-08-23 20:33:01 +00:00
Josh Elsasser 6323a59c6a Add workaround for broken bittyrant client name. 2007-08-23 06:44:52 +00:00
Charles Kerr 77e7bc4f84 make upnp's internal structures' naming schemes whallop-like 2007-08-21 20:38:34 +00:00
Charles Kerr 44f6cb1098 fix NaN error reported by persept 2007-08-21 16:26:01 +00:00
Charles Kerr bae07d471e added support for `corrupt' announce tag s.t. corrupted bytes don't count towards your download ratio 2007-08-21 15:17:02 +00:00
Charles Kerr 8c54b7eb46 ensure that all the tracker destruction code is done in the libevent thread, for a cleaner shutdown 2007-08-21 00:01:14 +00:00
Charles Kerr 624257c995 better cleanup on shutdown. don't crash when the torrent doesn't support scrape. (Gimp :) 2007-08-20 23:37:08 +00:00
Charles Kerr 64faed5c47 better saving of run/stopped state. 2007-08-20 23:36:18 +00:00
Charles Kerr 1d6e20594d minor improvements to.. you guessed it.. the tracker/libevent code 2007-08-20 02:29:36 +00:00
Charles Kerr 1f08d0ce52 cleaner shutdown 2007-08-20 02:18:38 +00:00
Charles Kerr 8f0c231a3a fix FMR on shutdown 2007-08-20 02:12:55 +00:00
Charles Kerr 4e82903313 better fix for the leak in r2870 2007-08-19 04:03:06 +00:00
Charles Kerr e19ecccae8 send libevent's warning messages to our logging framework instead of to the console 2007-08-19 03:54:27 +00:00
Charles Kerr b0919dca34 ...and, yet another memory leak, this time when trying to add a torrent that can't be added 2007-08-19 03:42:58 +00:00
Charles Kerr 47f1457d67 fix crash-on-shutdown bug reported by BentMyWookie 2007-08-19 02:55:11 +00:00
Charles Kerr 7b2a9f274a accidentally checked in a debugging statement 2007-08-19 02:23:35 +00:00
Charles Kerr 027fa13c5b fix win32 build. (#304, lubomir.marinov) 2007-08-19 02:10:18 +00:00
Charles Kerr 13c91c2d99 upnp.c needs platform.h if VERBOSE_LOG is defined (ticket #305, mtolman) 2007-08-19 02:07:29 +00:00
Charles Kerr 82db9f6cc9 fix a couple of more memory leaks that valgrind found 2007-08-19 00:18:43 +00:00
Charles Kerr b66efdf998 tracker tweaks 2007-08-19 00:02:23 +00:00
Charles Kerr 1e53e9de72 shut up a compiler warning 2007-08-18 23:32:07 +00:00
Charles Kerr 8f78b809d1 fix minor memory leaks introduced in the last couple of days 2007-08-18 22:35:09 +00:00
Charles Kerr 633ade8004 added mirek's slovakian translation. added mirek, Niels Provos, and TooMuchTime to the `thanks' sectio of AUTHORS 2007-08-18 18:33:47 +00:00
Charles Kerr ea49180f94 $Id$ 2007-08-18 17:19:49 +00:00
Charles Kerr 43bfc5cd7f update version.sh to exclude third-party. add $Id:$ to the new files s.t. version.sh will find them. 2007-08-18 17:05:51 +00:00
Charles Kerr b9c2ea46ce add the content-length header. I'm not getting any tracker errors anymore; please let me know if your experience differs 2007-08-18 15:47:08 +00:00
Charles Kerr 39a43cbc08 * more work on the tracker... getting closer.
* oops!  make sure autoconf is giving the `0.80+' in the User-Agent header.
2007-08-18 08:28:57 +00:00
Charles Kerr 3a45686c3f push event_del() through the libevent pipe too. 2007-08-18 06:59:20 +00:00
Charles Kerr 9cb2dcb63d better error reporting in the new tracker code 2007-08-18 06:06:53 +00:00
Charles Kerr 3f777e3cb9 before the first scrape, set leechers/seeders/downloads to -1 to represent n/a 2007-08-18 03:11:08 +00:00
Charles Kerr 35b727788e do all the libevent enqueuing from a single thread. 2007-08-18 03:02:32 +00:00