Commit Graph

193 Commits

Author SHA1 Message Date
Jordan Lee c8bec40e3f (trunk libT) fix potential null pointer dereference in announcer.c 2011-03-31 03:37:50 +00:00
Jordan Lee 9f122a021a (trunk libT) better scrape management on private trackers.
If a private tracker scrape says that there are no downloaders in the swarm, mark all the peers in the private swarm as seeds. This can greatly reduce unnecessary overhead on large seedboxes. We don't do this same trick on public torrents, since a public tracker won't know of all the peers.
2011-03-29 15:18:25 +00:00
Jordan Lee 1101ba8d57 (trunk libT) strip trailing whitespace 2011-03-28 13:37:46 +00:00
Jordan Lee b54ebeafd7 (trunk libT) remove the tr_session argument from the announce/scrape response callbacks 2011-03-26 12:06:04 +00:00
Jordan Lee 324f0f470c (trunk libT) copyediting: '#include "crypto.h"' cleanup 2011-03-25 01:21:31 +00:00
Jordan Lee 375694eda9 (trunk) copyediting: remove some unneeded #includes, and annotate some needed ones 2011-03-24 21:49:42 +00:00
Jordan Lee b4d36aeb54 (trunk) #4138 "use stdbool.h instead of tr_bool" -- done. 2011-03-22 15:19:54 +00:00
Jordan Lee 40defc8fb2 (trunk libT) #117 "UDP tracker protocol support" -- fix trivial r12141 log message typo: s/Unsupported ur/Unsupported url/ 2011-03-20 15:33:45 +00:00
Jordan Lee f4b4ddd231 (trunk libT) better shutdown management of libutp and UDP trackers in tr_sessionClose().
This is a little overlapping since the utp code can be closed more-or-less immediately, but the udp manager needs to stay open in order to process the udp tracker connection requests before sending out event=stopped. Moreover DNS resolver can be shut down after the UDP tracker is shutdown.
2011-03-17 18:51:31 +00:00
Jordan Lee 501f2e106f (trunk libT) move tr_lpdAnnounceMore() out of the announcer module
We can stop local peer discovery immediately during shutdown, but need to leave the announcer running for the event=stopped messages. So it doesn't make sense to keep them on the same periodic timer.
2011-03-17 12:45:29 +00:00
Jordan Lee 6835374661 (trunk libT) move tr_dhtUpkeep() out of the announcer module
During shutdown, we can stop DHT almost immediately, but need to leave the announcer running for the DHT tracker event=stopped messages. So it doesn't make sense to keep them on the same periodic timer.
2011-03-17 12:34:43 +00:00
Jordan Lee 374ed10f3b (trunk) it's bad form to #include so many system headers in libtransmission/utils.h... 2011-03-16 18:04:23 +00:00
Jordan Lee 591b95286f Show whether a tracker is http or udp. Without that context, it could be confusing to see the same tracker twice in a tier 2011-03-15 17:03:09 +00:00
Jordan Lee 15e2e7d491 (trunk libT) annnouncer.c: as discussed with Waldorf, massage the tracker lists a bit:
1. remove duplicate URLs caused by implicit vs. explicit port numbers
2. if two announce URLs are duplicates /except/ for their scheme, put them in the same tier.
3. try announce URLs with a "udp" scheme before trying ones with an "http" scheme.
2011-03-15 03:21:25 +00:00
Jordan Lee 297c24a8a0 (trunk libT) more announce.c work: better handling of incrementing the retry interval on scrape failures 2011-03-14 16:52:47 +00:00
Jordan Lee 46b85c7994 (trunk libT) more tweakin' 2011-03-14 02:40:39 +00:00
Jordan Lee 2cca699f06 (trunk libT) #117 "UDP tracker support (BEP #15)" -- added request timeout
UDP announce and scrapes now have a 120 second TTL.
2011-03-13 06:38:54 +00:00
Jordan Lee 3cfef5eded (trunk libT) #117 "UDP tracker protocol support" -- working implementation; needs testing and valgrinding and review. 2011-03-13 00:18:11 +00:00
Jordan Lee 99ab56a82f (trunk libT) copyediting: removing trailing spaces from lines 2011-03-11 15:44:24 +00:00
Jordan Lee 7d551f609c (trunk libT) implement multiscrape. 2011-03-11 15:11:37 +00:00
Jordan Lee a3cfc11268 (trunk libT) repeat the r12129 fix for delegating https scrapes 2011-03-11 13:04:09 +00:00
Jordan Lee 9704888172 (trunk libT) fix r12127 bug with delegating https trackers 2011-03-11 05:48:57 +00:00
Jordan Lee ef5bb89e91 (trunk libT) optimization for ocelot.
When seeding on a private tracker, ocelot omits other seeds from the list of peers returned. We can test for this and update our "seed probability" field accordingly.
2011-03-11 04:57:53 +00:00
Jordan Lee b46d3a2713 (trunk libT) #117 "UDP tracker protocol support (BEP #15)" -- refactor announcer.c so that alternate tracker protocols can be supported.
This commit adds a set of package-visible structs and functions to allow delegating announces and scrapes to different protocol handlers. (Examples: struct tr_announce_request, struct tr_announce_response, struct tr_scrape_request, struct tr_scrape_response.) HTTP is the only protocol handler currently implemented; however, this provides a clean API for other protocol handlers, and having this in trunk will help shake out any bugs in this refactoring.

In addition, logging via the TR_DEBUG_FD environment variable is vastly improved in the announcer module now.
2011-03-11 04:19:01 +00:00
Jordan Lee b38466323b (trunk libT) use a hex key for tracker announces. 2011-03-10 11:46:22 +00:00
Jordan Lee 9bf2434e14 (trunk) copyediting: remove trailing spaces from source code lines in daemon/ gtk/ libtransmission/ and utils/ 2011-03-04 23:26:10 +00:00
Jordan Lee 9024cb29f9 (trunk libT) #3208 "Local Peer Discovery idea: prioritize LPD requests for downloads" -- add patch from Eszet 2011-03-04 17:33:29 +00:00
Jordan Lee 716a3c90c2 (trunk) #4032 "Better error detection / reporting in http announces" -- added to trunk.
This patch adds two new flags to the callback function -- did_connect and did_timeout -- that are calculated inside of web.c using information from libcurl. This allows the announcer to detect timeouts more accurately and also to distinguish between unresponsive peers (which get the preexisting "Tracker did not respond" error message) and unconnectable peers (which get a new error message, "Could not connect to tracker").
2011-02-17 02:26:24 +00:00
Jordan Lee 2b905bdbcc (trunk libT) silence minor "unused function argument" compiler warning 2011-02-07 23:09:36 +00:00
Jordan Lee 11c0517cc8 (trunk libT) #3931 "'Announce is Queued' but doesn't get announced" -- remove the 'unresponsive tracker' penalty from torrents whose announce time has been reached.
The 'bad tracker' penalty was introduced in 2009 after a top tier trackers went down. Announces to it would hang, tying up an announce slot in libcurl for minutes at a time. If a user had enough torrents from that tracker, it could bottleneck all announce slots. The workaround was to deprioritize failing trackers so that they wouldn't obstruct other trackers.

Its implementation could be better, however. There are two parts:

  1. Deciding how frequently to retry unresponsive trackers

  2. Once an unresponsive tracker announce was ready to go, it would be bumped down the queue if other announces were ready too.

Part 2 probably contributes to #3931. If there are enough torrents loaded, there will always be good tracker announces that get pushed ahead of a bad one in the queue. Modifying 2's heuristics would be one option, but it seems simpler to remove it altogether now that getRetryInterval() grades more hashly for consecutive failures. Altering the retry interval also gives better visual feedback to users than Part 2 did.

This commit removes "Part 2" as described above.
2011-02-05 18:46:10 +00:00
Jordan Lee ddfb113f70 (trunk libT) announcer.c cleanup, part 1
Separating this commit into a few different stages. This one is superficial/readability changes, such as grouping related functions together.
2011-02-05 16:45:06 +00:00
Jordan Lee a9e104d591 (trunk libT) #3931 "announce is queued" -- minor revision for uClibc compatibility
jusid reports that powl() doesn't exist on uClibc, so getRetryInterval() needs to work without it. A simple left-bit shifting would be fine, but since we max out after a handful of cases, a switch statement seems slightly more readable than shifting or powl().
2011-01-30 16:23:53 +00:00
Jordan Lee e492bcf7d0 (trunk libT) "Announce is Queued" but torrent doesn't announce itself to trackers -- simplify http response code handling 2011-01-29 19:04:02 +00:00
Jordan Lee f36fc1246c (trunk libT) #3934 "manual reannounce doesn't work if the initial announce failed" -- fixed.
Use tor->isRunning, rather than tier->isRunning, when testing to see if a torrent can manual announce or not.  tor->isRunning means we're inbetween the user pressing "start" and "stop." tier->isRunning means we're inbetween successful "started" and "stopped" announcements. (This is deliberately out-of-sync from tor->isRunning because it can take awhile to for tracker announces to finish.)

Under the old code (using tier->isRunning), it was impossible to manually reannounce unless there had been a successful event=started announce first. It was also possible to manually announce after the "stop" button had been pressed if the "event=stopped" announcement hadn't finished yet.
2011-01-22 19:56:01 +00:00
Jordan Lee 75ffe999d4 (trunk libT) #3933 "announcer.c peer parsing could be simpler" -- fixed.
Remove redundant code by using tr_peerMgrCompactToPex() and tr_peerMgrCompact6ToPex() to parse compact ipv4 and ipv6 peer lists. Simplify the old-style benc peer list parsing and fix a bug that returned too few bytes in the old-style peer array.
2011-01-22 17:45:54 +00:00
Jordan Lee 5b382d203e (trunk libT) #3870 "transmission doesn't recheck after getting initial 404" -- fixed.
The exponentially-growing interval between retries had a bug that caused intervals to be too long if no successful announce had ever been made. This commit fixes the code that calculates the interval.
2011-01-20 22:51:05 +00:00
Jordan Lee bca543dc8e (trunk libT) #3923 "remove redundant announcer.c debug message" -- done. 2011-01-20 20:49:09 +00:00
Jordan Lee 879a2afcbd Update the copyright year in the source code comments.
The Berne Convention says that the copyright year is moot, so instead of adding another year to each file as in previous years, I've removed the year altogether from the source code comments in libtransmission, gtk, qt, utils, daemon, and cli.

Juliusz's copyright notice in tr-dht and Johannes' copyright notice in tr-lpd have been left alone; it didn't seem appropriate to modify them.
2011-01-19 13:48:47 +00:00
Jordan Lee 8aa0f36a37 cleanup of who calls the libtransmission thread locking functions.
In some cases we were calling them from deep inside libtransmission, when they should have been called directly from the public-visible API functions: tr_torrentWebSpeeds_KBps(), tr_torrentPeers(), tr_torrentTrackers().
2011-01-18 23:44:36 +00:00
Jordan Lee e12788c626 (trunk libT) fix formatting error in a couple of old calls to dbgmsg() 2011-01-12 05:05:48 +00:00
Charles Kerr e5bb3205a1 (trunk) Join the 21st century and use only 1 space at the end sentences. This commit is nearly as important as the semi-annual ones that remove trailing spaces from the ends of lines of code... :) 2010-12-27 19:18:17 +00:00
Charles Kerr ae84dc70dd (trunk libT) #3836 "libevent2 support" -- finish moving to the libevent2 API mode. don't include the backwards-compatable API headers. 2010-12-24 08:58:41 +00:00
Charles Kerr 345b14adbc (trunk) #3836 "libevent2 support" -- bump libevent2 requirement to 2.0.10. This will break the Mac build for a minute intil BMW applies his Mac patch 2010-12-20 02:07:51 +00:00
Charles Kerr e8ba22fc11 fix irrelevant text formatting error. :/ 2010-12-03 23:14:04 +00:00
Charles Kerr e957353a85 (trunk libT) r11448 seems to have been a red herring, so undo that commit. 2010-12-03 23:10:24 +00:00
Charles Kerr 11b34daea2 (trunk libT) possibly fix the "no announce scheduled" issue reported in the forums 2010-12-03 21:53:37 +00:00
Charles Kerr 498452fba4 (trunk libT) #3689 "libtransmission/announcer.c's announceURLIsSupported() function is redundant" -- removed. 2010-10-30 16:19:27 +00:00
Charles Kerr 82781cf2a7 (trunk libT) #3666 "byteCount stored on a 32bits integer" -- fixed. 2010-10-24 21:35:23 +00:00
Charles Kerr ad613b05f7 (trunk libT) #3638 "fewer crypto calls when creating peer-ids, session ids, announcer keys, etc" -- fixed. 2010-10-17 18:32:55 +00:00
Charles Kerr 80f69ee7d3 (trunk) fix svn properties on several files. Thanks ot Elbandi for suggesting this 2010-10-01 13:33:39 +00:00
Charles Kerr c86b87a511 (trunk) revert the RPC behavior of rateUpload, rateDownload, rateToClient, and rateToPeer as discussed with Longinus00 2010-09-03 04:30:43 +00:00
Charles Kerr 92e06acf74 (trunk) RPC: add "scrape" to the trackerStats array, making it a proper superset of the "trackers" array. Also, very minor tweaks to the RPC spec 2010-09-01 20:54:04 +00:00
Charles Kerr 841be713d1 (trunk libT) #3383 "When port forwarding, check to see if the public port matches the private port" -- fixed 2010-07-05 21:04:17 +00:00
Charles Kerr a5a1f38393 (trunk libT) fix more issues found by -Wconversion 2010-07-01 05:14:34 +00:00
Charles Kerr db44d81b24 (trunk) #3256 "libtransmission/publish.[ch] should be replaced" -- apply publish.diff for 2.10 2010-06-19 14:33:10 +00:00
Charles Kerr 462e473410 (trunk libT) when TR_CURL_VERBOSE is set, also log the benc announce response 2010-06-10 15:18:02 +00:00
Charles Kerr 60ce7e5263 (trunk libT) #3258 "Transmission 1.93 sends 'stopped'+'started' announce instead of 'completed' if the incomplete-dir is enabled" -- probable fix 2010-06-03 16:37:50 +00:00
Charles Kerr 37f90426c1 (trunk libT) revert r10661 s.t. DHT peers are preferred slightly over PEX peers. This reversion comes after reading "Understanding the Properties of the BitTorrent Overlay" (2007, Al-Hamra) @ http://arxiv.org/pdf/0707.1820 at Juliusz's suggestion. Also tweak the announce's 'numwant' threshold based on findings from the same paper. 2010-05-28 01:41:30 +00:00
Charles Kerr 5ca8d41816 (trunk libT) #2929 "persistent tracker error messages in main window" -- experimental fix 2010-05-19 19:02:25 +00:00
Charles Kerr fcc56ddcd5 (trunkn libT) #3192 "crash in most recent nightlies" -- fixed in trunk for 2.00 2010-05-18 15:14:54 +00:00
Charles Kerr 1aef6e1a03 (trunk libT) code tweak 2010-05-18 13:07:37 +00:00
Charles Kerr ad27c9d58e (trunk libT) #3203 "torrents halted after 'Tracker returned a 4xx message'" -- fixed in trunk for 2.00 2010-05-11 13:32:29 +00:00
Charles Kerr 2b9ab542cb (trunk) #3060 "Local Peer Discovery" -- in the code, rename LDS as LPD for Local Peer Discovery 2010-05-08 08:42:45 +00:00
Charles Kerr 5a34347f4f (trunk) #3060 -- Local Peer Discovery patch from Eszet 2010-05-01 16:04:00 +00:00
Charles Kerr 546bca723b (trunk libT) #3159 "better decision-making when choosing which peers to initiate new connections with" -- experimental commit 2010-04-20 21:54:03 +00:00
Charles Kerr fe3d9ed95a (trunk) one of the least interesting commits ever: remove trailing spaces from source code lines... 2010-03-17 17:07:40 +00:00
Mitchell Livingston bd635f22d0 for scrapes: add a new field to distinguish from error messages returned from the tracker, and scrape timeouts, so that they can be displayed differently 2010-02-25 23:06:05 +00:00
Charles Kerr d0e5e68ac1 (trunk libT) when calling tr_torrentSetAnnounceList(), reset the tracker IDs to new, but unique, numbers synchronized between tr_info and the torrent stats 2010-02-22 00:11:19 +00:00
Charles Kerr 71ed8193b8 (trunk libT) (1) reduce the default tracker announce timeout from 120 to 90 seconds. (2) for partial seeds, send an event=paused when we transition from being leeches to partial seeds, just as you would send an event=completed when becoming a seed 2010-02-20 21:03:49 +00:00
Charles Kerr 7a33a9170e (trunk libT) revise r10238 to be a little more readable 2010-02-20 17:17:57 +00:00
Charles Kerr 9b68c1ec97 (trunk libT) comment out a couple of console debug messages 2010-02-20 16:33:20 +00:00
Charles Kerr 5a9a07b71e (trunk) #2938 "crash when adding a torrent by URL from an ftp source over RPC" -- fixed in trunk for 1.91 2010-02-20 15:57:05 +00:00
Charles Kerr a973e38bb5 (trunk libT) #2922 "announce's 'download' field should follow the de facto standard" -- added to trunk for 1.91 2010-02-20 15:36:25 +00:00
Charles Kerr be80f3bbde (trunk libT) more improvements to tr_announcerResetTorrent() 2010-02-14 05:34:03 +00:00
Charles Kerr 586602a13a (trunk libT) annother announcer tweak, this time to resolve a problem reported by Longinus00 in #transmission on freenode that 404 responses incorrectly caused Transmission to announce again 2010-02-14 05:16:04 +00:00
Mitchell Livingston 26ccf12b3e #2902 New tracker addition field obscured when trackers vertically fill inspector view 2010-02-14 04:48:12 +00:00
Charles Kerr cf95714968 (trunk libT) handle 404 errors more gracefully. error reported by Longinus00 in #transmission on freenode 2010-02-14 03:54:35 +00:00
Charles Kerr 617e80d767 (trunk libT) #2850 "tr_torrentSetAnnounceList() should not trigger reannounces to trackers" -- further revision to get newly-added tiers to announce 2010-02-14 03:40:39 +00:00
Charles Kerr 2ad6e06ea6 (trunk libT) #2850 "tr_torrentSetAnnounceList() should not trigger reannounces to trackers" -- tweak to r10193 2010-02-14 03:28:54 +00:00
Charles Kerr 057b80a9f9 (trunk libT) "tr_torrentSetAnnounceList() should not trigger reannounces to trackers" -- implemented in trunk for 1.90 2010-02-13 21:58:38 +00:00
Charles Kerr 5c9cd2c2db (trunk libT) revert part of r10064 at livings' request 2010-02-11 03:12:03 +00:00
Mitchell Livingston 9407b5f0f0 chop off a bit of text in an announce error message 2010-02-11 02:52:54 +00:00
Charles Kerr c35d4696ee (trunk libT) re-add the supportcrypto, requirecrypto announce arguments that were removed during announce testing in r10090 2010-02-11 00:43:47 +00:00
Charles Kerr 42fcfbe804 (trunk libT) try to fix the mac build. This commit still has the announce logging code. 2010-02-10 04:42:34 +00:00
Charles Kerr 7efdd92f86 (trunk libT) oops, a couple of debugging printf()s snuck into the commit 2010-02-10 03:57:41 +00:00
Charles Kerr 2472970c53 (trunk libT) fix 1.82 memory corruption error reported by john doe 2010-02-10 02:59:15 +00:00
Charles Kerr 8ba3442408 (trunk libT) fix the &event= key when telling the tracker that a partial seed is being stopped 2010-02-09 21:51:11 +00:00
Charles Kerr 1724553212 (trunk) per-tier up/down/corrupt byte counts for announcing to trackers 2010-02-08 16:47:30 +00:00
Charles Kerr 74e3484e75 (trunk) add a new field to distinguish from error messages returned from the tracker, and announce timeouts, so that they can be displayed differently 2010-02-05 05:16:18 +00:00
Charles Kerr 7519f51fe9 (trunk libT) #2854 "Tracker did not respond" -- when calculating the interval to wait before retrying a failed announce or scrape, take into account that tracker's responses to other torrents' announces/scrapes 2010-02-05 01:47:33 +00:00
Charles Kerr b3d0309034 (trunk libT) #2854 "tracker did not respond" -- when both scrapes and announces are vying for a turn, give announces a higher priority 2010-02-05 01:16:30 +00:00
Charles Kerr d118db0f37 (trunk libT) remove dead announce fields like supportscrypto and requirescrypto. these don't appear to be supported by any of the major clients so why waste the announce bandwidth... 2010-02-03 06:32:14 +00:00
Charles Kerr 5014319622 (trunk libT) experimental commit for faster tracker announces 2010-02-03 03:38:13 +00:00
Charles Kerr e62be48baa (trunk libT) don't scrape paused torrents 2010-02-02 02:59:40 +00:00
Charles Kerr dd9da625d1 (trunk libT) a better way to ignore peerCount from `stopped' responses 2010-02-01 03:49:59 +00:00
Charles Kerr 13179c5363 (trunk libT) ignore the peer count from `stopped' responses when calculating lastAnnouncePeerCount 2010-02-01 03:39:54 +00:00
Charles Kerr 7cb57b8480 (trunk libT) don't reset lastAnnouncePeerCount when stopping a torrent. 2010-02-01 01:13:25 +00:00
Charles Kerr f071f0ccea (trunk libT) another announcer tweak related to #2828 -- keep the last known good value of lastAnnouncePeerCount even if subsequent announces fail 2010-02-01 00:35:38 +00:00
Charles Kerr 9423821e7a (trunk libT) #2828 "Better reporting of announce timeouts in tr_tracker_stat" -- implemented in trunk for 1.90 2010-02-01 00:28:04 +00:00
Charles Kerr 73deb80e77 (trunk libT) if a tracker doesn't respond during an announce, instead of automatically reannouncing in 120 seconds, add some fuzz to the interval. Rationale: if a bunch of torrents announce at once, overloading the router or server, they'll still be overloading it if we do the exact same thing the second time around... 2010-01-28 19:33:48 +00:00