Jordan Lee [Sun, 20 Mar 2011 15:28:41 +0000 (15:28 +0000)]
(trunk libT) #117 "UDP tracker protocol support" -- (1) fix connection attempt retries after a failed connection attempt. (2) extract method from tau_tracker_upkeep() for clarity: tau_tracker_send_reqs() and tau_tracker_timeout_reqs()
refactor the timeout/request code a bit.
Jordan Lee [Thu, 17 Mar 2011 18:51:31 +0000 (18:51 +0000)]
(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.
Jordan Lee [Thu, 17 Mar 2011 13:16:23 +0000 (13:16 +0000)]
(trunk libT) as a followup to r12182, move LPD's periodic upkeep timer into the tr-lpd.c module where it can be started & stopped with the pre-existing tr_lpdInit() and tr_lpdUninit() functions.
Jordan Lee [Thu, 17 Mar 2011 12:45:29 +0000 (12:45 +0000)]
(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.
Jordan Lee [Thu, 17 Mar 2011 12:34:43 +0000 (12:34 +0000)]
(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.
Jordan Lee [Thu, 17 Mar 2011 04:16:19 +0000 (04:16 +0000)]
(trunk libT) #117 "UDP tracker protocol suppoort" -- in case the tracker gives an error message in response to a connection response, store the error message in the scrape/announce response structs' errmsg fields.
Jordan Lee [Wed, 16 Mar 2011 17:42:32 +0000 (17:42 +0000)]
(trunk libT) move the single-use utility function "evbuffer_ref_cleanup_tr_free()" from a public header into a private function to limit its visibility/scope
Jordan Lee [Tue, 15 Mar 2011 03:21:25 +0000 (03:21 +0000)]
(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.
Jordan Lee [Sun, 13 Mar 2011 14:37:30 +0000 (14:37 +0000)]
Add htonll() ntohll() to our AC_CHECK_FUNCS set s.t. the wrappers in libtransmission/utils.c can shop the work out to the system libraries if those functions are available.
Jordan Lee [Sun, 13 Mar 2011 08:15:40 +0000 (08:15 +0000)]
(trunk libT) use libevent2's portability wrappers for inet_ntop() and inet_pton().
We currently implement our own versions of these on mingw because that platform doesn't have them... but why reinvent the wheel; libevent has already done the same thing. Let's use libevent2's implementation.
has already done it for us.
Jordan Lee [Fri, 11 Mar 2011 04:57:53 +0000 (04:57 +0000)]
(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.
Jordan Lee [Fri, 11 Mar 2011 04:19:01 +0000 (04:19 +0000)]
(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.