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
fee784f1d8
(trunk) #4081 "Add 'cookieString' argument 'torrent-add' method in RPC" -- done.
2011-03-15 04:22:47 +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
cc55286261
(trunk libT) #117 "UDP tracker protocol support (BEP #15 )": (1) use the UDP tracker error response's error string (2) better handling of requests that timeout (3) better filtering of non-tracker UDP messages
2011-03-14 14:15:58 +00:00
Jordan Lee
6b682f8042
(trunk libT) make tr_ptrArrayNth() an inline function
2011-03-14 14:09:41 +00:00
Jordan Lee
46b85c7994
(trunk libT) more tweakin'
2011-03-14 02:40:39 +00:00
Jordan Lee
11e0883ee4
(trunk libT) fix array-bounds-read in the UDP tracker code when an announce or scrape request times out
2011-03-14 02:39:11 +00:00
Jordan Lee
4fc6c1ada2
(trunk libT) add attribution for the fallback tr_htonll() and tr_ntohll() code
2011-03-13 20:39:08 +00:00
Jordan Lee
58c084fbda
(trunk libT) better implementation of tr_htonll() and tr_ntohll()
2011-03-13 20:23:23 +00:00
Jordan Lee
cdff3aa090
(trunk libT) minor tweak: use evutil_closesocket() instead of the older EVUTIL_CLOSESOCKET() macro.
2011-03-13 19:47:21 +00:00
Jordan Lee
e3fab720d1
(trunk) make sure all files with $Id$ has svn:properties set
2011-03-13 14:38:49 +00:00
Jordan Lee
dc8e97eb43
(trunk libT) tweak #includes in announcer-http.c
2011-03-13 14:33:28 +00:00
Jordan Lee
4f6d031a9f
(trunk libT) fix tau_send crash reported by Waldorf overnight in #4114
2011-03-13 14:18:35 +00:00
Jordan Lee
075a0a8b86
(trunk libT) use libevent's portability wrapper for strcasecmp()
2011-03-13 08:21:55 +00:00
Jordan Lee
4a4842fea5
(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.
2011-03-13 08:15:40 +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
7a24257d00
(trunk libT) tweaks by werehamster
2011-03-13 05:45:34 +00:00
Jordan Lee
5ad95ee3d5
(trunk libT) fix minor memory leak reported by rpc-server.c
2011-03-13 00:35:11 +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
76fdae97cb
(trunk libT) #4106 "Assert in buildHandshakeMessage, r12131" -- probable fix
2011-03-11 19:28:44 +00:00
Jordan Lee
77a0a0b619
remove unused field
2011-03-11 17:26:41 +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
d1f3a885a5
(trunk libT) ensure that a tr_torrent's peer id is initialized when the tr_torrent is constructed
2011-03-11 15:00:10 +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
896c9b54e1
(trunk libT) Add an enumeration for the peer id length. Use that enum for the peer_id fields in tr_session and tr_torrent.
...
This also avoids an extra malloc/free per-torrent and per-session, but mostly this tweak is for the extra readability of the PEER_ID_LEN=20 enum.
2011-03-10 12:35:23 +00:00
Jordan Lee
b38466323b
(trunk libT) use a hex key for tracker announces.
2011-03-10 11:46:22 +00:00
Jordan Lee
3933d84e1c
(trunk libT) #4084 "after reaching seed state, no new peers are acquired" -- possible fix.
...
This revises r12110 based on feedback from sadface about the use of tr_atom.uploadOnly.
2011-03-07 14:59:47 +00:00
Jordan Lee
b4538e0625
(trunk libT) copyediting.
...
1. make some accidentally-public functions/variables private
2. comment out tr_generateAllowedSet() since we're not using it
3. argument list indentation
2011-03-07 14:33:45 +00:00
Jordan Lee
d2270852af
(trunk libT) simpler implementation of the idea behind the code removed in r12108 and r12109.
2011-03-07 04:48:46 +00:00
Jordan Lee
6b4d500c36
(trunk libT) finish r12108
2011-03-07 03:46:26 +00:00
Jordan Lee
c9897ff97a
experimental fix for #4084
2011-03-06 23:49:40 +00:00
Jordan Lee
9e07e19b05
(trunk libT) #4085 "transmission crashed when adding a new torrent: assert failed" -- possible fix?
2011-03-05 16:29:19 +00:00
Jordan Lee
7ad41603e9
(trunk libT) #2338 : "uTP support" -- enable uTP by default.
2011-03-05 16:19:56 +00:00
Jordan Lee
f015bafdbf
(trunk libT) #4083 "Wrong shades of progress in Inspector pieces view." -- fixed.
...
The problem was reported by Rolcol and tracked down by livings124. It's flashing orange because the completion in "availability" doesn't match the completion in in "progress", which corresponds with tr_torrentAvailability() and tr_torrentAmountFinished(). tr_cpGetAmountDone() was recently reworked in r12012 for #4048 , which caused the problem. Both functions need to sample the torrent using the same methodology so that their results can be used together.
2011-03-05 03:51:57 +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
918f6a96e0
(trunk libT) fix possible memory leak in tr-udp's EV_READ handler.
...
The EV_READ callback allocates a buffer, but then returns without freeing it if recvfrom() returns <= 0. This commit inverts the logic to avoid returning until the buffer's been free()d.
2011-03-04 21:38:04 +00:00
Jordan Lee
3fdd80eb0d
(trunk libT) new function: tr_ssToAddr()
...
This handles converting the data in a sockaddr_storage to a tr_address + port, and removes redundant code from fdlimit.c and tr-udp.c that previously did this work.
2011-03-04 21:00:52 +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
b10aea6fcc
(trunk) #4072 "remove the 'know peer count' field in Inspector" -- remove it from libtransmission too
2011-03-04 04:50:50 +00:00
Jordan Lee
a1b81cd152
(trunk libT) fix peerDestruct() crash when peer doesn't have a corresponding atom
2011-03-04 04:45:12 +00:00
Jordan Lee
020bde5ce6
(trunk libT) a bit of futzing: remove a few more unnecessary casts from void*
2011-03-03 21:51:11 +00:00
Jordan Lee
0cf05fdffd
(trunk libT) add an "existing dir" argument to tr_fdFileCheckout().
...
existing_dir: An ancestor of filename which must already exist and won't be created by tr_fdFileCheckout(). In implementation this is the download directory and prevents directories from being created in error, such as a mount point for an external drive when the drive is unplugged.
2011-03-03 19:59:12 +00:00
Jordan Lee
c6f52ecb11
remove a handful of unnecessary casts
2011-03-03 19:56:44 +00:00
Jordan Lee
0c36e0c9de
(trunk libT) remove the unused tr_ratecontrol code. switch webseed over to using tr_bandwidth.
2011-03-03 18:33:24 +00:00
Jordan Lee
6d94a33f2d
(trunk libT) #4070 "assertion failure happens soon after startup" -- fixed.
...
Thanks to User294 for helping to track down the problem.
2011-03-03 17:28:04 +00:00
Jordan Lee
f9c6deab6f
(trunk libT) minor revision to r12065: clamp the bandwidth before applying the ratio calculation
2011-03-03 07:20:18 +00:00
Jordan Lee
ab3cc08258
(trunk libT) #4078 "Better calculation of the bitfield length while still a magnet link" -- fixed.
2011-03-02 15:00:12 +00:00
Jordan Lee
6e84fb89fa
(trunk libT) work in progress, but this is a slightly better speed limiting for mixed tcp/utp peers
2011-03-02 07:21:58 +00:00
Jordan Lee
0e27f583d3
(trunk libT) #4047 "transfer speed shown as 0" -- revert r11783 ( #3950 ) because it caused speed misreporting.
2011-03-01 15:23:13 +00:00
Jordan Lee
aa89303254
(trunk libT) #4073 "suggest inclusion of <signal.h> in torrent.c" -- done.
2011-02-28 13:10:56 +00:00
Mitchell Livingston
73956c6a4f
store secondsDownloading and secondsSeeding as ints instead of time_t
2011-02-26 15:01:07 +00:00
Mitchell Livingston
6092362c1e
revert the last commit
2011-02-26 14:59:05 +00:00
Mitchell Livingston
39709abd6e
store secondsDownloading and secondsSeeding as ints instead of time_t
2011-02-26 14:56:58 +00:00
Jordan Lee
cff172bbd5
(trunk libT) peer-mgr.c peerCallbackFunc(): Replace some "should always be true" tests with assert()s. These tests used to be useful, but I don't think they are anymore. The assert()s have been put in their place to test that theory...
2011-02-25 01:48:46 +00:00
Jordan Lee
9d95bd151d
(trunk libT) #4035 "In seed state, transmission disconnect from leechers" -- fixed.
2011-02-24 14:35:45 +00:00
Jordan Lee
6dc20636bb
(trunk libT) utils-test.c: remove some debugging stubs that should not have been checked in
2011-02-24 04:16:47 +00:00
Jordan Lee
25366156b1
(trunk libT) make the tr_bitsetToBenc() and tr_bitsetFromBenc() functions follow bitset.c's variable naming convention of how the "this" pointer is named
2011-02-24 04:14:12 +00:00
Jordan Lee
f4992d885c
(trunk libT) if we're a partial seed and the peer has everything we have, disconnect.
2011-02-24 01:50:35 +00:00
Jordan Lee
0c6c569b69
(trunk libT) minor cleanup: improve the function names torrentConstructor() and torrentDestructor().
...
These functions actually allocate/free the memory where these objects reside, so it's clearer to name them torrentNew() and torrentDelete().
2011-02-23 06:18:09 +00:00
Jordan Lee
bf8e4594e0
(trunk libT) minor cleanup: improve the function names peerConstructor() and peerDestructor().
...
These functions actually allocate/free the memory where these peer objects reside, so it's clearer to name them peerNew() and peerDelete().
2011-02-23 06:14:06 +00:00
Jordan Lee
f2b4a59eda
(trunk libT) #4051 "Use composition for the tr_history fields in tr_peer" -- fixed.
...
If we use composition on these objects we can save a handful of pointers per peer. This isn't a big deal, but it's an easy/safe change to do.
2011-02-23 06:01:16 +00:00
Jordan Lee
2b9db3c242
(trunk libT) #4048 "use bitsets instead of bitfield in tr_completion" -- done.
...
Excuse the sprawl. Much of this didn't fit into self-contained commits.
2011-02-23 03:54:04 +00:00
Jordan Lee
094b726316
(trunk libT) remove unused code: tr_bitfieldIsEmpty()
2011-02-21 15:43:41 +00:00
Jordan Lee
32237dbdb0
(trunk libT) remove unused functions: tr_bitsetDifference() tr_bitfieldDifference()
2011-02-21 15:36:07 +00:00
Jordan Lee
6ab918a202
(trunk libT) code cleanup: moving bitset functions to their own .c file.
2011-02-21 01:40:19 +00:00
Jordan Lee
25ad6bbad2
(trunk libT) remove dead code in peer-common.h: the tr_addreq_t enum
2011-02-21 01:15:13 +00:00
Jordan Lee
1ccdb1a797
(trunk libT) web.c: free the unprocessed tasks before exiting the libcurl thread.
...
This is rare but can happen during shutdown if there are unresponsive trackers. Cleaning up the tasks improves the S/N ratio in valgrind a bit.
2011-02-21 01:13:28 +00:00
Jordan Lee
e77a627d3c
(trunk libT) mark the two "progress" args to tr_torrentSetLocation() as volatile.
2011-02-19 20:10:05 +00:00
Jordan Lee
05ff024dd8
(trunk libT) #3372 "What happened with closing idle peers?" -- fixed.
2011-02-19 12:32:41 +00:00
Jordan Lee
7a8ab0ddbe
(trunk libT) closeBadPeers() part 2 of 2: this function was serving two purposes, which wasn't clear from its name. refactor slightly to make the purpose and name match.
2011-02-19 12:30:18 +00:00
Jordan Lee
1592953439
(trunk libT) closeBadPeers() part 1 of 2: don't bother sorting these peers by activity -- we're closing -all- of them, so sorting them is pointless.
2011-02-19 12:24:00 +00:00
Juliusz Chroboczek
352981ee03
Remove obsolete UNUSED marker.
2011-02-18 21:55:42 +00:00
Jordan Lee
e2584b04ff
(trunk libT) #4047 "timeChecked for the last piece is not saved to a resume file" -- fixed.
...
A garden variety off-by-one error. good patch by jusid and revision by me.
2011-02-18 19:31:18 +00:00
Juliusz Chroboczek
e7fc697c90
Stub out UTP_Create in non-uTP builds.
2011-02-18 16:01:52 +00:00
Jordan Lee
80d06d4c34
(trunk libT) add a bool to tr_peer_stat and the RPC peer list to denote whether or not a peer's connected via µTP
2011-02-18 04:07:43 +00:00
Jordan Lee
b930026c40
(trunk libT) explicitly use the libevent2 header files, instead of the deprecated backwards-compatibility one
2011-02-18 01:25:32 +00:00
Jordan Lee
cba90ccace
(trunk libT) add stubs for UTP_Drained() and UTP_Write() to remove a few #ifdefs from peer-io.c
2011-02-18 01:18:51 +00:00
Jordan Lee
8e87147c61
(trunk libT) add a stub for UTP_Close() s.t. peer-mgr.c doesn't need the #ifdefs from r11960
2011-02-18 01:06:42 +00:00
Jordan Lee
cd04051de8
add configure script switch to enable/disable utp
2011-02-18 00:45:44 +00:00
Juliusz Chroboczek
40463b9d0a
Reinstate a variable removed by r11810.
2011-02-18 00:43:54 +00:00
Juliusz Chroboczek
828c9888b0
Don't attempt uTP connexions to peers learned from PEX that didn't signal support.
2011-02-18 00:43:49 +00:00
Juliusz Chroboczek
5af8e26251
Use large kernel buffers for the UDP socket when uTP is enabled.
...
Since we're using a single UDP socket to implement multiple uTP sockets,
and since we're not always timely in servicing an incoming UDP packet,
it's important to use a large receive buffer. The send buffer is probably
less critical, we increase it nonetheless.
2011-02-18 00:43:47 +00:00
Juliusz Chroboczek
a348c5d421
Don't call tr_utpClose in toggle_utp.
...
The uTP timer needs to run even when uTP has been disabled, or else the
uTP sockets will never time out.
2011-02-18 00:43:45 +00:00
Juliusz Chroboczek
2729d3c291
Don't mark atoms as non-uTP unless we failed to connect.
2011-02-18 00:43:43 +00:00
Juliusz Chroboczek
55b050f18e
Clear utp_failed flag upon seeing an announcement for ut_holepunch.
2011-02-18 00:43:39 +00:00
Juliusz Chroboczek
07addc7d0d
Try uTP connections by default.
2011-02-18 00:43:37 +00:00
Juliusz Chroboczek
2ba3305412
When failing to connect over uTP, fall back to TCP.
2011-02-18 00:43:34 +00:00
Juliusz Chroboczek
704f984bdf
Implement atom->utp_failed and peerMgrSetUpFailed.
2011-02-18 00:43:31 +00:00
Juliusz Chroboczek
5ba2e40f79
When uTP is disabled, don't call UTP_CheckTimeouts too often.
2011-02-18 00:43:27 +00:00
Juliusz Chroboczek
25b8d08537
When uTP is enabled, open uTP connections to some peers.
...
Since we don't implement falling back to TCP yet, we're very
conservative: we only use uTP when we have good reasons to believe
the peer speaks uTP.
2011-02-18 00:43:24 +00:00
Juliusz Chroboczek
cc96b12bbc
Fix typo.
2011-02-18 00:43:21 +00:00
Jordan Lee
004d30337b
when sending PEX messages, unset the holepunch flag because we don't support holepunch.
2011-02-18 00:41:32 +00:00
Jordan Lee
f00799f80c
if we successfully finish a handshake using uTP, mark the peer as supporting uTP
2011-02-18 00:41:06 +00:00
Jordan Lee
75badcd4ab
silence compiler warning
2011-02-18 00:40:53 +00:00
Jordan Lee
71486f8c86
call UTP_RBDrained when our read buffer is empty
2011-02-18 00:40:38 +00:00