Commit Graph

387 Commits

Author SHA1 Message Date
Jordan Lee d49b8b6650 (trunk, libT) #5467: 'transmission-daemon SEGFAULTs on startup without error message if ~/.config does not exist and ~ is not writeable' -- nice quick fix by mike.dld 2014-01-21 02:27:46 +00:00
Jordan Lee 4b9626bb83 Licensing changes:
1. add the option the code to be used under GPLv2 or GPLv3; previously only GPLv2 was allowed

2. add the "proxy option" as described in GPLv3 so we can add future licenses without having to bulk-edit everything again :)

3. remove the awkward "exception for MIT code in Mac client" clause; it was unnecessary and confusing.
2014-01-19 01:09:44 +00:00
Jordan Lee 4904b923fb (trunk) restore copyright year as suggested in email by rms 2014-01-18 20:56:57 +00:00
Jordan Lee d9a6539e19 fix pedantic compiler warnings 2013-09-09 01:32:09 +00:00
Jordan Lee 0e453bb873 (trunk, libT) improved/new MSVC portability wrappers dirname, basename, gettimeofday(). patch by mikedld, breakage by charles 2013-09-08 18:27:27 +00:00
Jordan Lee ea7d2482dd introduce TR_PRIuSIZE macro for portable printf()ing of size_t. mikedld 2013-09-08 17:32:09 +00:00
Jordan Lee 605e2e89ad use evutil_socket_t instead of int to define socket types. Patch my mikedLd :) 2013-09-08 17:03:11 +00:00
Jordan Lee f762c2ce6a treat bool args as booleans rather than ints; no need to compare them a la 'if (boolVal != 0)' 2013-08-24 18:08:38 +00:00
Jordan Lee 28fe36f1f8 #include limits.h where we use it, and don't where we don't 2013-08-24 17:53:45 +00:00
Jordan Lee 9182c34711 #5298 'Transmission not holding queue order' -- fixed with patch by gabrielrcp 2013-08-17 16:20:32 +00:00
Jordan Lee 29e53df9d9 silence a pair of 'unused variable' gcc warnings 2013-07-27 17:48:59 +00:00
Jordan Lee fe79ad39bc add tr_sessionGetTorrents(), a private utility to avoid code duplication in libtransmission 2013-07-20 15:37:13 +00:00
Jordan Lee de248c94fb in peer-msgs.c's tr_peerMsgsCalculateActive(), adjust some of those new tracer assertions to work better with magnet links. 2013-07-09 17:05:32 +00:00
Jordan Lee 74d0f305a6 move platform.c's quota code into its own file. Fixes FTBFS reported in bug #5389 and is also a nice piece of encapsulation. Patch by rb07 2013-07-08 17:07:31 +00:00
Jordan Lee 5452908346 whitespace/indentation 2013-05-23 05:43:12 +00:00
Jordan Lee 027e3f3066 (trunk, libT) #4682 'Add return id from duplicate torrent torrent-add rpc' -- added. 2013-05-22 20:35:38 +00:00
Jordan Lee fcdec9a8bc (libT) don't start the web thread until we have a task to feed to curl 2013-02-15 01:52:47 +00:00
Jordan Lee cd09204a6e (trunk) first draft of changing the FreeSpace API to behave as https://trac.transmissionbt.com/ticket/4076#comment:25 -- libT, rpc, qt, and gtk implementations. 2013-02-09 04:05:03 +00:00
Jordan Lee 407c0b53c7 (trunk) add portability wrappers tr_rename(), tr_remove() for the rename() and remove() funcs s.t. utf16 can be handled 2013-02-04 21:45:20 +00:00
Jordan Lee 1f2bccd17b (libT) recycle the peer id used for public torrents after N hours of use 2013-02-02 13:42:50 +00:00
Jordan Lee aa8ddcb218 (libT) remove pointless tr_session.peer_id variable 2013-02-02 05:31:43 +00:00
Jordan Lee f75027d5e9 make all the log functions/structs/enums use a single 'tr_log' namespace, such as tr_logGetQueue, tr_logAddInfo, tr_logIsLevelActive 2013-01-25 23:34:20 +00:00
Jordan Lee e2c1a360d4 (libT) replace errant snprintf() calls with tr_snprintf() calls 2013-01-23 04:28:37 +00:00
Jordan Lee 0da726e639 (libT) #4632 'custom blocklist generates 2x # of rules': add a fix, which causes r13825's test to pass 2013-01-21 21:14:14 +00:00
Jordan Lee 2d5fe73969 (libT) copyediting: rename the internal tr_blocklist class 'tr_blocklistFile' to distinguish the private per-file API from the public, global API in libtransmission.h 2013-01-21 17:48:36 +00:00
Jordan Lee 14dca05e21 (trunk, libT) #5199 'tr_sessionGetNextQueuedTorrent() can be faster' -- fix r13709 oops 2012-12-28 21:51:10 +00:00
Jordan Lee aa906ced75 (trunk, libT) #5199 'tr_sessionGetNextQueuedTorrent() can be faster' -- modify session.c's tr_sessionGetNextQueuedTorrents() and peer-mgr.c's getPeerCandidates() functions use the new tr_quickfindFirstK() utility" 2012-12-28 20:10:03 +00:00
Jordan Lee 9e86a38345 #3833 'freespace' -- fix memset error. 2012-12-28 05:28:37 +00:00
Jordan Lee 5f1f4934eb (trunk, libT) #3833 'freespace' argument for 'session-get' RPC method -- use TR_PATH_MAX instead of PATH_MAX for session.downloadDirFsType and session.downloadDirBlkDev 2012-12-27 20:22:32 +00:00
Jordan Lee 4cbe6a64e1 (trunk, libT) #3833 'freespace' argument for 'session-get' RPC method -- apply taem's 0003-Cache-download-dir-s-block-device-and-FS-type.patch​ to cache the download dir's block device and FS type 2012-12-27 19:45:01 +00:00
Jordan Lee c1559f3cc4 (trunk, libT) first drop of the tr_quark patch. 2012-12-22 20:35:19 +00:00
Jordan Lee aea6d7cd6f (trunk, libT) #5168 'make libtransmission's public funcs nonblocking when possible' -- remove tr_torrentRef() and tr_torrentUnref() as discussed in https://trac.transmissionbt.com/ticket/5168#comment:8 2012-12-14 20:04:37 +00:00
Jordan Lee e96ed247fe refactor libtransmission's tr_benc class as tr_variant. 2012-12-14 04:34:42 +00:00
Jordan Lee 079c78981c (trunk) #5168 'make libtransmission's public funcs nonblocking when possible' -- first attempt. 2012-12-12 20:22:57 +00:00
Jordan Lee 9ddd7e0166 preallocate a couple of dictionaries to the right size before using them. 2012-12-09 21:28:20 +00:00
Jordan Lee a2d2a10226 (trunk, libT) #5165: fix r13625 oops 2012-12-07 01:53:31 +00:00
Jordan Lee 3d38723ad9 Follow more common whitespace style conventions in the C code (libtransmission, daemon, utils, cli, gtk). 2012-12-05 17:29:46 +00:00
Mitchell Livingston 8e5a62ed40 add a missing @ to a comment 2012-09-18 03:46:01 +00:00
Mitchell Livingston 40e75b20ed return a value (and rename) testTurtleTime instead of passing in a flag to set 2012-09-18 03:44:59 +00:00
Mitchell Livingston ddabdcb1c7 remove a comment referring to a non-existant param 2012-09-18 01:13:31 +00:00
Mitchell Livingston e46309a0fa #4201 Automatic limit can't be stopped 2012-09-18 00:58:10 +00:00
Jordan Lee 3398a48e57 (trunk libT) #4402 "Transmission Bandwidth allocation getting overflows" -- use gvdl's patch '4402-uint-bpsoverflow.patch' 2012-07-01 02:17:35 +00:00
Jordan Lee d717248e75 (trunk libT) fix the Linux build wrt compiling with the new snapshot of libutp checked into r13317
Previously we made sure to include stdbool.h (via transmission.h) before utp.h, since the latter used 'bool' without defining it. The new snapshot defines it unconditionally in non-C++ code, so now we need to include it first.
2012-05-30 17:47:29 +00:00
Jordan Lee b2d65db45f (trunk) remove trailing spaces from code lines ;) 2012-02-03 16:44:07 +00:00
Jordan Lee ff303e6fd7 queuing: lower the default 'active downloads' value to 5 2011-08-08 16:29:47 +00:00
Jordan Lee 313bd9e211 Add a mechanism for enabling/disabling the stalled minutes feature. This is a pre-existing feature in the Mac client. 2011-08-07 19:24:33 +00:00
Jordan Lee 307754e807 #671 "torrent queuing" -- modify the queue implementation s.t. every torrent has a queuePosition, even if it's not currently in the queue. 2011-08-02 03:59:54 +00:00
Jordan Lee 61174b007e (trunk) #671 "torrent queuing" -- Preliminary implementation. Covers libtransmission; GTK+ and Qt clients, and rudimentary web client support. 2011-08-01 22:24:24 +00:00
Jordan Lee 3928a9d8e9 (trunk libT) #3219 "Don't scrape paused torrents" -- allow this as a 'hidden' option in settings.json, but don't add it to the GUI or to RPC. 2011-07-23 17:14:12 +00:00
Jordan Lee de34a0545b (trunk libT) minor #include cleanups 2011-07-13 03:23:37 +00:00
Jordan Lee 731ee3640c (trunk libT) remove unnecessary "UNUSED" attribute 2011-07-12 12:24:41 +00:00
Jordan Lee 35fb00fd9e (trunk libt) #4315 "Transmission 2.31 crashes (segfaults) immediately after launch" -- remove the "max-open-files" code.
max-open-files might have been a nice configuration option once, but (1) we've never advertised it in the gui apps, and (2) the crazy cases are causing more trouble than this feature is worth. It's more complicated now after #4164 -- see #4294, #4311, and this ticket.
2011-06-24 22:39:20 +00:00
Jordan Lee f134858453 (trunk libT) avoid thread issues on startup by ensuring that tr_sessionLoadTorrents() runs in the libtransmission thread. 2011-06-19 18:30:57 +00:00
Jordan Lee 33eb6d3f9e (trunk) #3817 remove OS proxy integration from the GTK+ client 2011-05-27 13:36:53 +00:00
Jordan Lee 52512857ae (trunk libT) better r12434 2011-05-16 07:11:21 +00:00
Jordan Lee 01461d0b4a (trunk gtk) more heap pruning:
querying gconf2 each time the curl callack function is called is expensive, so query it once -- then again later, if the proxy settings change -- and remember the values in a local struct.
2011-04-13 06:18:30 +00:00
Jordan Lee 525d854016 (trunk libT) when reading piece data in from a socket, avoid two unnecessary calls to memcpy() 2011-04-04 04:45:41 +00:00
Jordan Lee 1b02eb8641 (trunk libT) use aggregation for the tr_bandwidth objects owned by tr_session and tr_torrent 2011-03-31 14:53:22 +00:00
Jordan Lee 210068410d (trunk libT) merge tr_bitfieldTestFast() and tr_bitfieldTest() 2011-03-30 04:23:20 +00:00
Jordan Lee 83c0e4f011 (trunk libT) break the mac build and introduce new crashes.
This is partially to address #4145 "Downloads stuck at 100%" by refactoring the bitset, bitfield, and tr_completion; however, the ripple effect is larger than usual so things may get worse in the short term before getting better.

livings124: to fix the mac build, remove bitset.[ch] from xcode
2011-03-28 16:31:05 +00:00
Jordan Lee 9aafb0cb00 (trunk libT) minor code cleanup in announcer-udp: whitespace & function names 2011-03-26 10:22:25 +00:00
Jordan Lee 1b825079be (trunk libT) API cleanup of the tr_address functions to make them more consistent.
This is loosely related to #2910, but only in the sense of laying the groundwork for #2910's fix...
2011-03-25 05:34:26 +00:00
Jordan Lee 1304aa0079 (trunk libT) still fiddling around with #includes -- this time removing unncecessary libT includes from libT .c files 2011-03-25 01:41:57 +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 bf4eb642dc (trunk libT) remove dead code: tr_sessionSetLazyBitfieldEnabled(), tr_sessionIsLazyBitfieldEnabled() 2011-03-21 16:33:16 +00:00
Jordan Lee b9a508f9fe (trunk libT) remove unused configDir argument from tr_sessionGetDefaultSettings() 2011-03-21 16:22:39 +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 78a4865aa1 (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. 2011-03-17 13:16:23 +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 075a0a8b86 (trunk libT) use libevent's portability wrapper for strcasecmp() 2011-03-13 08:21:55 +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 7ad41603e9 (trunk libT) #2338: "uTP support" -- enable uTP by default. 2011-03-05 16:19:56 +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 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 cd04051de8 add configure script switch to enable/disable utp 2011-02-18 00:45:44 +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
Jordan Lee c4b1d1e6c5 (trunk libT) add C and RPC API for getting/setting uTP enabled flag 2011-02-18 00:33:11 +00:00
Juliusz Chroboczek 8599d7c037 Modify peer-io to work with UTP sockets.
This is not supposed to work yet -- it just adds new fields to the data
structures to get the UTP code to compile.
2011-02-18 00:23:51 +00:00
Jordan Lee 2f5fc4ade7 (trunk libT) #3959 "by default, disable prefetch for lightweight builds" -- fixed.
User jusid reports prefetch causes load on his NMT to jump from <1 to 3-4. He requests a way to disable prefetch, and suggests that prefetch be disabled by default on lightweight builds.  This commit adds a new settings.json key, "prefetch-enabled", which defaults to "true" on standard builds and "false" when compiled with --enable-lightweight.
2011-01-31 23:35:10 +00:00
Jordan Lee 4fbd6d8b19 (trunk libT) #3950 "use libevent's cached gettimeofday() value when appropriate" -- fixed. 2011-01-29 18:59:23 +00:00
Jordan Lee bbe51e1faf (trunk libT) #3955 "tr_torrentNext() should be inlined" -- fixed. 2011-01-29 18:54:43 +00:00
Jordan Lee 5d15ee8439 (trunk) #3949 "Add --enable-lightweight argument to configure" -- fixed.
TR_EMBEDDED has been around for awhile, but few (any?) repackagers are aware of it. If it was "advertised" through a configure-time argument, and in the status messages at the end of the configure script, more repackagers would be aware of it.
2011-01-27 03:53:02 +00:00
Mitchell Livingston a1eedd117d #3940 Global displayed speed does not include webseeds; remove a now-unused libT speed function 2011-01-23 18:23:52 +00:00
Jordan Lee 599d33035b (trunk libT) #3906 "DHT ignores bind-address-ipv6" -- make the process of getting the binding address consistent between IPv4 and IPv6 sockets.
As suggested by Juiusz after the IPv6 binding commit in r11749.  See: https://trac.transmissionbt.com/ticket/3906#comment:6
2011-01-22 20:43:36 +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
Juliusz Chroboczek 6f5ecd2ab8 Make the peer-socket-tos preference more user-friendly.
Possible values are now the strings default, lowcost, throughput etc.
Numeric values are used for non-standard values.
2011-01-15 17:10:54 +00:00
Juliusz Chroboczek 8ea2c0daa1 Make the peer-congestion-algorithm preference visible.
When I first implemented this code, I made the preference hidden --
unless you set it yourself, it will not appear in the sttings file.
Now that it's been documented and advertised, make it visible.
2011-01-15 16:25:24 +00:00
Juliusz Chroboczek abcd56c034 Move creation of the UDP sockets to tr-udp.c. 2011-01-09 21:48:36 +00:00
Juliusz Chroboczek 89aa3bb58e Implement tr_dhtInit and Uninit, use it in session.c. 2011-01-09 21:48:33 +00:00
Jordan Lee fde6b36e57 (trunk libT) prevent crash on shutdown when bindinfo ptr can be NULL 2011-01-05 08:07:04 +00:00
Jordan Lee 69a3b8bbab (trunk, daemon) #3833 "'freespace' argument for 'session-get' RPC method" -- committing patch from taem, reardon, and rb07 2011-01-05 04:41:19 +00:00
Charles Kerr b223a33b73 (trunk libT) fix crash reported by KyleK 2011-01-03 03:01:12 +00:00
Charles Kerr a17962d5fc (trunk libT) #3528 "TR_PREFS_KEY_BIND_ADDRESS_IPV4 breaks IPv6-only trackers" -- Implement suggestion #2 from Harry 2010-12-30 19:15:47 +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 16a5fa4073 (trunk) #1408 "total downloading and seeding time per torrent" -- add patch to track how long a torrent has been seeding or downloading 2010-12-23 19:32:59 +00:00
Charles Kerr 3a5d17cfde (trunk) #1538 "Make Web UI URL configurable" -- added to trunk. Patch by wereHamster 2010-12-12 18:22:11 +00:00
Charles Kerr ec18abf0a9 (trunk libT) raise the default cache size from 2 MB to 4 MB 2010-12-12 05:59:19 +00:00