Commit Graph

207 Commits

Author SHA1 Message Date
Jordan Lee 6897197729 (trunk, libt) #4147 'bad file descriptor': in cached_file_open(), ensure the file is always opened with writable permissions if we need to call ftruncate() to resize it. Large credit to karamanolev for tracking this down with strace. 2013-07-27 16:18:12 +00:00
Jordan Lee 4aa4012a73 fix race condition triggered in the unit tests by requiring a libtransmission thread lock in torrentRemove() 2013-01-31 05:05:44 +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 818308376b (libT) #5102 'don't invalidate the OS' filesystem cache when closing files -- done. 2013-01-18 19:20:22 +00:00
Jordan Lee 106dfe2985 copyediting: indentation/whitespace 2012-12-18 03:03:23 +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
Jordan Lee 0d13057111 (trunk libT) fix warnings in fileset_get_empty_slot() found by llvm's static-build analyzer.
static-build found a potential NULL pointer dereference. The circumstances where this could get triggered don't seem very likely, but doesn't hurt to fix the warning.
2011-12-14 05:42:15 +00:00
Jordan Lee 434a988165 (trunk libt) #4305 "New Torrent via RPC Error:No data found when subfolder does not exist" -- revert r12076 s.t. parent directories are created as necessary when saving local data to disk. 2011-07-25 17:48:14 +00:00
Jordan Lee 2c69c42554 (trunk libT) restore setrlimit(), although in an non-configurable mode. 2011-07-11 20:48:06 +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 513a3fcc1d (trunk libT) tr_torrentGetFileMTime(): if the file being looked at is aleady open in fdlimit's file cache, use that cached handle instead of deriving our own. 2011-04-28 18:40:46 +00:00
Jordan Lee a8377b1b7a (trunk libt) #4164 "__FD_SETSIZE impact on open-file-limit and peer-limit-global" -- commit patch by romanr to take FD_SETSIZE into account before calling setrlimit() 2011-04-19 15:23:04 +00:00
Jordan Lee bbc35bd546 (trunk libT) use FD_SETSIZE instead of __FD_SETSIZE 2011-04-16 22:41:14 +00:00
Jordan Lee f9d5e7a72c (trunk libT) #4165 "__FD_SETSIZE impact on open-file-limit and peer-limit-global" -- add safety guard in the file cache to prevent too many open files. 2011-04-16 22:33:29 +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 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 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 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 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 2b8124d3ad (trunk) #4019 "Minor patch, kill useless casts in transmission source." -- fixed. patch by jlouis
jlouis used Coccinelle to scan transmission's source for redundant code that casts a type to its own type.
2011-02-12 17:27:47 +00:00
Jordan Lee 3f9886c3dd (trunk libT) silence compiler warning in libtransmission/fdlimit.c: "ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result" 2011-02-09 05:34:23 +00:00
Jordan Lee 22660ed751 (trunk libT) #3973 "JIT verification verifies fresh downloaded torrents" -- improvement to r11813.
r11813 fixed the timestamp issue by fsync()ing files before close()ing them in tr_close_file(). This causes a little overhead as even read-only files cause a sync as their atimes are modified. Instead, we should call fsync() further back in the call chain in tr_fdFileClose() so that we can know to only sync torrent files that were opened with write access.
2011-02-02 23:29:17 +00:00
Jordan Lee 4bf6f0ac40 (trunk libT) #3973 "JIT verification verifies fresh downloaded torrents" -- win32 portability fix for r11813.
fsync() doesn't exist on Windows. bencode had a private function, tr_fsync(), that is a portability wrapper around fsync() on *nix and _commit() on win32. Make this function package-visible, rather than private, so fdlimit.c can use it too.
2011-02-02 23:19:54 +00:00
Jordan Lee 5fc1ff8855 (trunk libT) #3973 "JIT verification verifies freshly-downloaded torrents" -- test fix.
Files downloaded in Transmission 2.20 betas [1..3] forced each piece to be checked twice -- once on download, and once when uploading the piece for the first time. Older versions of Transmission didn't perform the latter check unless the file had changed after it was downloaded. This commit restores that behavior.
2011-02-02 20:30:04 +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 1cd74312ba (trunk libT) minor code cleanup in fdlimit.c 2011-01-07 00:17:13 +00:00
Jordan Lee d18b1bda05 (trunk) #3875 "Typo: missing gettext macro _ in recent commit" -- fix r11602 regression discovered by ijuxda 2011-01-06 01:05:13 +00:00
Charles Kerr d16a424f76 (trunk libT) more fdlimit futzing 2010-12-28 08:38:55 +00:00
Charles Kerr a04f92729e (trunk libT) refactor libtransmission's file cache 2010-12-28 07:24:10 +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 f713451647 (trunk libT) #3531 "Pausing 500 torrents uses 650 MB of memory" -- on OS X, when saving a benc/json file, send a hint to the OS to not cache the file. 2010-12-17 15:36:31 +00:00
Charles Kerr a9d0190a0e (trunk libT) #3826 "all data fails its checksum test in uClibc 0.9.27" -- refinement of r11530 based on research by iz0bbz to find which version of uClibc added a fix. 2010-12-14 14:41:23 +00:00
Charles Kerr 6e52ccb239 (trunk libT) #3826 "don't use pread() or pwrite() on uclibc" -- fixed. 2010-12-14 05:07:06 +00:00
Charles Kerr 9335e02e6d (trunk libT) add some new bugs to the code so that it will crash when vraa tries to use it 2010-11-11 15:31:11 +00:00
Charles Kerr 01ab067e9c (trunk libT) #3662 "libtransmission cpu optimization: fewer calls to tr_time_msec()" -- fixed. 2010-10-24 01:08:08 +00:00
Charles Kerr 6c3d651ffe (trunk) #3618 "FreeBSD 8.1 & GCC 4.2.1 compiler warnings" -- fix some compiler warnings. 2010-10-11 21:44:46 +00:00
Charles Kerr 6f5c9dcafb (trunk libt) rename tr_date() as tr_time_msec() for clarity 2010-07-11 20:49:19 +00:00
Charles Kerr acd27a8c3b (trunk libT) #3371 "experimental use of F_NOCACHE to ameliorate inactive memory on OS X" 2010-06-27 17:44:34 +00:00
Charles Kerr 08628333d1 (trunk libT) part of rb07's win32 portability patches from ticket #3311 2010-06-21 16:44:35 +00:00
Charles Kerr 99318552eb call fcntl(F_NOCACHE,1) right before closing a local datafile. Does it have any effect? Who knows. 2010-06-21 13:08:04 +00:00
Charles Kerr 872291cd62 (trunk libT) make tr_pwrite()'s "buf" argument const 2010-05-22 00:09:36 +00:00
Charles Kerr 40a9133ced (trunk libT) remove dead code 2010-05-20 14:05:27 +00:00
Charles Kerr 7936f0d5d1 (trunk libT) clean up #includes for event.h and evutil.h 2010-05-19 16:17:51 +00:00
Charles Kerr 8e85b1c6e5 (trunk libT) fdlimit.[ch] MIT -> GPL. There's not any MIT code left there. 2010-05-17 16:41:59 +00:00
Charles Kerr 0051b8a110 re-tweak the previous commit based on feedback from kklimonda 2010-05-06 17:02:31 +00:00
Charles Kerr 2ea9f78eff (trunk libT) tweak MAX_PATH_LENGTH a little for better portability -- defer to limits.h's definition when present 2010-05-06 15:07:18 +00:00
Charles Kerr 99d53d7ef7 (trunk libT) #2849 "when possible, use fallocate64() for file preallocation" -- do this even when sparse preallocation mode is selected. 2010-03-09 16:19:59 +00:00
Charles Kerr b850349479 (trunk) #2993 "'Downloaded' much greater than 'Have' or 'verified'" -- add new congestion-based throttle for 2.0 2010-03-08 04:29:58 +00:00