Commit Graph

242 Commits

Author SHA1 Message Date
Charles Kerr 3759c98d76 (trunk libT) #2551 "better buffer cache management": apply jch's prefetch-base.patch 2009-11-08 23:43:38 +00:00
Charles Kerr 858e691381 (trunk libT) add a wrapper function, tr_netCloseSocket(), around EVUTIL_CLOSESOCKET() so that not all of our code has to #include evutil 2009-10-27 20:27:27 +00:00
Charles Kerr c85ee09fef (trunk) trunk's just been too stable lately. #2119: reload settings.json on SIGHUP 2009-10-23 03:41:36 +00:00
Charles Kerr c59ae60488 libT doesn't need to create the Incomplete directory until it's needed 2009-10-21 19:33:37 +00:00
Charles Kerr eef6177f0a (trunk libT) #1483: fix bug introduced in r9328 2009-10-20 20:19:41 +00:00
Charles Kerr 05c77cc975 (trunk) #1483: move completed torrents to a user-specified directory + #629: different file extension for incomplete files 2009-10-19 05:05:00 +00:00
Charles Kerr c7e2a29f57 add better logging to track down tr_ioRead() error messages reported by Rabbitbunny 2009-09-08 06:25:40 +00:00
Erick Turnquist fbfaeda8df (trunk libT): do EAFNOSUPPORT check on socket() errno on all platforms 2009-08-17 18:49:21 +00:00
Charles Kerr 1c5b344c85 (trunk libT) remove dead code noticed by geirha 2009-08-15 15:52:10 +00:00
Charles Kerr cb79214854 (trunk) remove trailing spaces 2009-08-10 20:04:08 +00:00
Charles Kerr 12f8339406 (trunk libT) remove dead code 2009-07-17 17:23:03 +00:00
Eric Petit 67440b9286 Don't assume that errnos are positive (they are not on Haiku), and
pass them on through an additional parameter if needed
2009-07-09 18:14:33 +00:00
Charles Kerr 5917436e60 (trunk libT) remove dead code 2009-07-04 04:33:23 +00:00
Charles Kerr 1104a4bf4d (trunk libT) dead code removal 2009-07-03 19:45:29 +00:00
Charles Kerr 587ddb48f0 (trunk libT) #2228: transmission should learn to truncate files on updating torrents 2009-06-21 07:53:51 +00:00
Charles Kerr ef9896e223 (trunk libT) more efficient closing of a torrent's open files 2009-06-21 07:36:51 +00:00
Charles Kerr 45f1316bce (trunk libT) #2196: add a fallback implementation of preallocateFileFull() in case the os-specific and fs-specific approaches don't work. 2009-06-16 17:10:47 +00:00
Erick Turnquist 1c7ac5bea0 (trunk libT) fix "dereferencing pointer does brea strict-aliasing rules" warning 2009-06-15 05:16:36 +00:00
Charles Kerr e082548030 (trunk) remove the test for fallocate(), since we used posix_fallocate() as a fallback anyway. <http://www.lucas-nussbaum.net/blog/?p=332> says: "Glibc does have posix_fallocate(), which implements the POSIX interface. posix_fallocate() is wired to use the fallocate system call, for sufficiently modern versions of glibc." 2009-06-14 18:32:09 +00:00
Charles Kerr dfc6e904d0 (trunk libT) fix copy/paste error in tr_fdAccept() 2009-06-08 14:50:56 +00:00
Charles Kerr 3f03f2e0c3 (trunk libT) #2151: possible fix for "Unusually high CPU usage in latest builds" issue 2009-06-06 16:19:34 +00:00
Charles Kerr ea93eab02d (trunk libT) on platforms that support it, use POSIX_FADV_SEQUENTIAL instead of POSIX_FADV_RANDOM. (http://trac.transmissionbt.com/ticket/1521#comment:25) 2009-05-31 21:20:49 +00:00
Charles Kerr 29b1d3e2cc (trunk) #920: add "move data" to libT so all clients can use it 2009-05-13 15:54:04 +00:00
Charles Kerr a0597ec8fb (trunk libT) clean up the debugging messages added to smoke out #2030 2009-05-07 13:03:39 +00:00
Charles Kerr 091abed323 (trunk libT) do for tr_close_file() what r8348 did for tr_open_file_for_scanning() 2009-05-07 11:54:09 +00:00
Charles Kerr c1a8c7363a (trunk libT) possible fix for #2030 2009-05-06 19:06:19 +00:00
Charles Kerr 1ee9ce9da7 (trunk libT) remove some oddness in tr_open_file_for_scanning() 2009-05-06 13:33:40 +00:00
Charles Kerr b52ae72009 (trunk libT) prevent stupid double-close error introduced a few minutes ago :/ 2009-04-26 21:00:58 +00:00
Charles Kerr 698aa192aa (trunk libT) convert tr_open_file_for_scanning() and tr_close_file() to use file descriptors instead of file pointers so that we don't have to mix and match between them 2009-04-26 20:44:18 +00:00
Charles Kerr 75520acd38 (trunk libT) tweak tr_open_file_for_scanning() on OS X for sequential, non-cached reading suitable for verify() and tr_fileLoad() 2009-04-26 19:50:31 +00:00
Charles Kerr d99438bd1c (trunk libT) need feedback from Mac users on this change. On Linux, it gets rid of the inactive-memory-grows-during-torrent-verification behavior that's often reported as a bug. 2009-04-26 00:51:51 +00:00
Charles Kerr 2b8f8166bd (trunk libT) possible IO speedup on OS X based on feedback from ticket #1967 2009-04-10 14:26:01 +00:00
Charles Kerr 2877eddd58 (trunk libT) experimental commit to reduce IO lag during fast downloads 2009-04-10 00:58:26 +00:00
Charles Kerr 87e4c99fbb (trunk libT) #1976: build problem with r8173: "erreur: ‘POSIX_FADV_SEQUENTIAL’ undeclared" 2009-04-07 20:25:32 +00:00
Charles Kerr 1e327f593d (trunk libT) #1966: add explicit support for preallocating files on XFS filesystems 2009-04-05 14:04:07 +00:00
Charles Kerr c3b24bc471 (trunk) modify tr_torrentParse() and tr_torrentNew() arguments s.t. they use the ctor's session instead of passing it in again. Allow a NULL session pointer for some cases of tr_torrentParse(). 2009-04-02 17:30:29 +00:00
Charles Kerr 1e8c374fd5 (trunk libT) fsync busy files every 15 seconds or so. On linux, use posix_fadvise() to tell the system no to cache torrent blocks 2009-01-26 00:36:34 +00:00
Charles Kerr 9d7c74cc8a (trunk libT) try again to make hudson-t happy wrt posix_fadvise() 2009-01-25 23:47:07 +00:00
Charles Kerr 3b7494efd2 (trunk libT) possibly make hudson-t happy on Linux 2009-01-25 23:40:08 +00:00
Charles Kerr 00125c9726 (trunk libT) add mac, linux, and win32 support for os-level hints that local data will be read in random order, to disable readahead buffering. 2009-01-25 23:33:10 +00:00
Charles Kerr 5ea9bcacbc (trunk libT) fix a minor memory leak. 2009-01-18 15:15:10 +00:00
Charles Kerr c1e1fedff9 (trunk libT) check in some of the extra error logging messages developed last night while chasing down the problem denis found 2009-01-17 15:08:20 +00:00
Charles Kerr c99f941d16 (trunk libT) make file preallocation optional via settings.json. choices are: full, sparse, and none 2009-01-16 16:38:16 +00:00
Charles Kerr 55aa6d834f (trunk libT) make the default number of open files 32 rather than 16, and make it configurable via settings.json. (Reported by Lucius Windschuh via denis_) 2009-01-08 19:20:24 +00:00
Charles Kerr d463cdb509 (trunk libT) eliminate a couple more unnecessary malloc() + free() pairs 2008-12-30 03:29:09 +00:00
Erick Turnquist a68764fcba (trunk libT) Don't log two "errors" we expect to see from time-to-time.
EAFNOSUPPORT: On OS X, socket() incorrectly throws EAFNOSUPPORT for certain
IP/Port combinations. There is nothing we can do about this.

ENETUNREACH: #1606 is evidence that some trackers return IPv6 peers when
contacted over IPv4. This code will silently ignore "network unreachable"
errors for IPv6 connections.
2008-12-20 08:51:32 +00:00
Charles Kerr 54be88dec3 (trunk libT) add ipv6 support by jhujhiti. I think this is the largest user-contributed patch we've ever used... thanks jhujhiti :) 2008-12-15 00:17:08 +00:00
Mitchell Livingston 31482813b9 BeOS and Amiga support is, at least for now, a lost cause and hasn't worked for long over a year - removing from the source (if you for whatever unknown reason still need this, get it through SVN) 2008-12-02 03:57:01 +00:00
Charles Kerr 0d5fed6442 (libT) re-apply jhujhiti's IPv6 patch. This merges in my tr_port cleanup, so any new bugs are mine :/ 2008-12-02 03:41:58 +00:00
Charles Kerr a14621c363 (libT) janitorial: use the tr_port type whenever we have a `port' as a function argument or as a field in a struct. 2008-12-01 20:51:01 +00:00
Charles Kerr 7fa9813955 (libT) #252: revert r7195 (jhujhiti's IPv6 test patch). It seems to be the culprit in a `thrashing' issue reported by Waldorf and m1b in irc -- the behavior appeared between r7183 and r7187 -- so this commit is to trigger off a nightly build w/o the patch to test with in irc. 2008-12-01 20:21:06 +00:00
Charles Kerr a2ad4f6543 (libT) patch from jhujhiti to add ipv6 support. 2008-11-30 00:47:18 +00:00
Charles Kerr d12af295c1 use tr_bool instead of C bitfields. (http://blogs.msdn.com/oldnewthing/archive/2008/11/26/9143050.aspx) 2008-11-28 22:11:41 +00:00
Charles Kerr aee1a0b9a0 (libT) revert r7099 based on forum feedback @ <http://forum.transmissionbt.com/viewtopic.php?f=4&t=6485> 2008-11-23 17:05:44 +00:00
Charles Kerr 6116a00c0b (libT) #1482: fix another win32-related preallocate bug. Thanks to Spry and Lubomir for fixing my bugs. ;) 2008-11-19 17:48:24 +00:00
Charles Kerr 65ec586835 (libt) #1482: libtransmission/fdlimit.c preallocateFile uses undeclared desiredFileSize on WIN32 2008-11-19 16:06:31 +00:00
Charles Kerr 10714dc224 (libT) get file preallocation working on Windows by copying how fsutil does it. (source: http://social.msdn.microsoft.com/forums/en-US/vclanguage/thread/4dabec8e-2909-40b3-b398-66bd4c587b9b/) 2008-11-15 19:59:18 +00:00
Charles Kerr 36019841b8 (libT) don't use getrlimit() / setrlimit() anymore. this doesn't do much good and could possibly do harm wrt fighting with libcurl for available sockets. 2008-11-12 04:05:27 +00:00
Charles Kerr 0e79d23b2c (libT) better testing for fallocate() on linux 2008-11-12 03:59:30 +00:00
Charles Kerr 10566eece9 (libT) #849: preallocate files when possible to prevent disk fragmentation 2008-11-05 05:56:06 +00:00
Charles Kerr 06939cafa6 (libT) low-hanging fruit discovered from softwareelves' shark profile. 2008-10-26 15:39:04 +00:00
Charles Kerr 67282cb794 further win32 portability fixes from Spry 2008-10-19 17:43:04 +00:00
Charles Kerr b5c2f14387 (libT) dead code removal 2008-10-14 20:44:41 +00:00
Charles Kerr c2ddf1b2fe fix oops 2008-10-14 04:51:42 +00:00
Charles Kerr b04be5fb2e make MAX_PATH_LENGTH private to libtransmission. add tr_dirname() and tr_basename() utility / portability wrappers 2008-10-14 03:39:16 +00:00
Charles Kerr e3a5524189 have tr_buildPath() allocate memory from the heap rather than using an input buffer 2008-10-14 03:03:29 +00:00
Charles Kerr 88ce8a5c44 more changes inspired by spry's `winport' code: for portability, use the standard __VA_ARGS__ macro for variadic macros instead of the CPP extensions. 2008-10-13 22:45:05 +00:00
Charles Kerr 4fab4c9e9b (libT) finish killing tr_errno. 2008-10-03 04:49:06 +00:00
Charles Kerr cc89872dd4 run libT, cli, daemon, gtk through the source-code formatter "uncrustify" as promised/threatened 2008-09-23 19:11:04 +00:00
Charles Kerr d39005b0d1 uncrash the build 2008-08-22 20:53:19 +00:00
Charles Kerr 815bf68082 crash deeper inside libtransmission. do not use this build; it crashes on purpose to test part of the nightly build system 2008-08-22 20:06:51 +00:00
Charles Kerr 51aff87443 lots of C correctness tweaks suggested by sparse/cgcc 2008-08-11 19:05:02 +00:00
Charles Kerr b860119cd3 minor text cleanup 2008-08-01 16:43:22 +00:00
Charles Kerr 2c79888a93 RPC/IPC redesign 2008-05-18 16:44:30 +00:00
Charles Kerr 47021f1a12 fold most of the "deep logging" functions into a single function 2008-04-25 02:57:33 +00:00
Charles Kerr a331582ec0 string folding 2008-03-30 13:52:55 +00:00
Charles Kerr 84a8592d1d first cut at adding i18n hooks into libtransmission. 2008-03-04 02:02:25 +00:00
Charles Kerr e4a59e5e27 fix minor compiler warning. 2008-02-25 03:09:55 +00:00
Charles Kerr cfe068876e remove unnecessary #includes 2008-02-19 18:39:49 +00:00
Charles Kerr deaeb24cb5 cleanup #includes for errno & strerror 2008-02-19 04:16:04 +00:00
Charles Kerr f72ba4b8d8 #663: connection limits don't work correctly. 2008-01-28 21:05:50 +00:00
Charles Kerr 1b7706e101 finish the trunk/1.0x libT merge: router death & portability 2008-01-21 02:11:57 +00:00
Charles Kerr de515ee339 if the torrent's download path doesn't exist, don't create it -- it's might be a removeable disk that got unplugged. 2008-01-18 19:13:32 +00:00
Charles Kerr 8c6c822acd mingw portability fixes: getrlimit/setrlimit in fdlimit 2008-01-10 19:22:11 +00:00
Charles Kerr 8bc02db55e mollify a noisy debugging message 2008-01-08 20:08:45 +00:00
Charles Kerr 57579bf576 #378 - use {get,set}rlimit to deal with open file limits 2008-01-03 16:36:20 +00:00
Charles Kerr ce6c33b7bf set copyright info to 2008 2008-01-01 17:20:20 +00:00
Charles Kerr 245915258f turn off a debugging message gone wild 2007-12-30 18:46:18 +00:00
Charles Kerr 60fb68cb7a silence a debug message gone wild 2007-12-28 06:14:18 +00:00
Charles Kerr 35adeec1d0 (gtk) fix startup port issue by hitting it with a damn big hammer 2007-12-24 07:02:40 +00:00
Charles Kerr 5c4f841c7e added tr_torrentSetPeerLimits(), tr_torrentGetPeerLimits(), tr_setGlobalPeerLimit(), tr_getGlobalPeerLimit() 2007-12-20 21:44:16 +00:00
Charles Kerr 36391e02c1 add support for TRANSMISSION_HOME environment variable so I can have multiple copies of Transmission running concurrently in different directories. 2007-12-15 22:22:30 +00:00
Charles Kerr 4ff5b472a8 raise the maximum connection limit a bit. 2007-12-15 16:36:43 +00:00
Charles Kerr ffe9e52e14 I think this one-line change may fix all the "Transmission 0.95 ate my data, corrupted my hard drive, and killed my cat!" complaints 2007-12-09 15:26:27 +00:00
Charles Kerr de9080e9ef fix tyop 2007-12-03 16:51:22 +00:00
Charles Kerr f0d1fa0a76 finish fixing the recursive mutex + cond bug reported by sedatg & Waldorf 2007-12-03 15:27:38 +00:00
Charles Kerr c68af92039 fix very annoying recursive mutex + pthread cond bug reported by setatg, Waldorf, and many others 2007-12-03 04:06:45 +00:00
Charles Kerr 260033847f fix ticket #451 (Files remain in use after removal) 2007-11-21 16:16:59 +00:00
Charles Kerr 3929b37da3 denis is right about r3880; we should respect umask 2007-11-19 12:59:26 +00:00
Charles Kerr a654f808e3 change TR_MKDIR_PERM from 0777 to 0755
change TR_CREAT_PERM from 0666 to 0644
2007-11-19 04:46:49 +00:00
Charles Kerr a2609ae2a7 fix permissions issue reported by Jaybird in http://transmission.m0k.org/forum/viewtopic.php?t=2944 2007-11-17 16:20:08 +00:00
Charles Kerr 76626796f3 make the hard drive less noisy than it was in 0.92 2007-11-10 05:09:40 +00:00
Charles Kerr fd430fde90 undoing the r3773-r3774 experiment. 2007-11-09 20:07:52 +00:00
Charles Kerr 67b719c2de on Darwin, use NSCParameterAssert() instead of assert(). 2007-11-09 19:50:40 +00:00
Charles Kerr 5da8a977c6 * add O_LARGEFILE support to fdlimit for the benefit of 32-bit posix machines
* minor tweaks
2007-11-09 04:32:19 +00:00
Charles Kerr 71f4efcbad update our #includes now that libevent has cleaned up event.h 2007-11-07 18:26:19 +00:00
Charles Kerr 7ce8312ddc fix memory error reported by John_Clay 2007-11-02 20:27:03 +00:00
Charles Kerr 3e0e462b10 finish cleaning up the code that was churned during the "corruption" fix. 2007-11-01 13:47:32 +00:00
Charles Kerr e625b10d6d "corruption" fix part 3: cleanup. remove unneeded possible points of failure. 2007-10-31 18:10:55 +00:00
Charles Kerr 96351b93ef part 1 of the data corruption fix: plug the leaky abstraction in fdlimit 2007-10-30 18:35:06 +00:00
Charles Kerr fef89a3bc7 * record the ports of incoming sockets. we might need them later if we want to disconnect and reconnect.
* for portability, use libevent API for some socket upkeep
2007-09-25 23:10:34 +00:00
Mitchell Livingston 76da1185ca merge encryption branch to trunk (xcode project is still out of date) 2007-09-20 16:32:01 +00:00
Charles Kerr ef2fc4fdcf More win32 portability fixes. we now talk to tracker & peers; hash checks work, downloads seem to work. w00t 2007-08-02 23:33:40 +00:00
Charles Kerr 6763ec75e8 more portability fixes 2007-08-02 21:58:34 +00:00
Charles Kerr 1fd5f90a77 win32 cleanly compiles and starts now. (still doesn't atually *work*, but we're getting closer...) 2007-08-02 19:43:29 +00:00
Charles Kerr 26caf4f5dd More Win32 portability changes 2007-08-01 00:40:49 +00:00
Charles Kerr 0f85cc3297 continue whittling away at internal.h to reduce the global #include dependencies 2007-07-31 14:26:44 +00:00
Charles Kerr d209052051 add portability wrapper for in_port_t... 2007-07-30 18:04:10 +00:00
Charles Kerr ebb141b232 better encapsulation of platform-specific constructs: tr_thread_t, tr_cond_t, tr_lock_t 2007-07-30 15:27:52 +00:00
Charles Kerr e07d0220a9 this looks bug but it's not: just janitorial cleanup, moving #includes from headers into source file 2007-07-29 18:11:21 +00:00
Charles Kerr 486f483751 xmission: load torrents on startup and populate the torrent list. 2007-07-22 02:24:13 +00:00
Charles Kerr 1d932b07c7 fix looooong-standing bug that choked tracker connections 2007-07-21 17:35:47 +00:00
Josh Elsasser 1ecbe8da65 Change a couple functions to take an in_addr pointer instead of an in_addr.
Forward declare struct in_addr and include the relevant headers in the .c files where it's used.
2007-07-14 16:29:21 +00:00
Charles Kerr f0d97e1a02 fix bug that gave the wrong peer count when uploading. 2007-07-13 22:22:46 +00:00
Charles Kerr 6f09fbe18d add #include files for stat() 2007-07-13 00:15:45 +00:00
Charles Kerr 790476ac23 clean up #includes a bit. 2007-07-12 17:51:45 +00:00
Charles Kerr 06e761d950 * fix error checking large files reported by Gimp_
* portability changes to pathname/filename building
* small gratuitous changes
2007-06-18 19:39:52 +00:00
Charles Kerr 3b8d1e13c4 uninteresting minor stuff like adding const. this commit is just to reduce the shear between trunk and what lands in the file-selection branch. 2007-06-09 15:36:46 +00:00
Josh Elsasser 63bb617fa4 Add more I/O error codes. 2007-04-20 02:05:07 +00:00
Josh Elsasser f884a9c4d4 Store the peers's listening port instead of the peer connections's remote port. 2007-01-28 00:24:41 +00:00
Eric Petit c1963147d3 Probably fixes the recent problem with disappearing peers 2007-01-23 17:59:21 +00:00
Eric Petit 40d8abb68f More simplifications 2007-01-21 19:42:11 +00:00
Eric Petit 14aa4e5ab0 Officially give up on making libT reentrant, and simplify our code instead 2007-01-21 07:16:18 +00:00
Eric Petit 4a567871bb clean up 2007-01-19 11:19:20 +00:00
Eric Petit e5e6a8b5df Merge io branch into trunk 2007-01-14 12:00:21 +00:00
Eric Petit f199e0a9d9 Revert [619] 2006-07-16 19:39:23 +00:00
Mitchell Livingston 5d36721a15 Remove old Sparkle... 2006-07-16 19:28:19 +00:00
Eric Petit f98fe6a1b0 Added $Id$ keywords and updated a few headers 2006-05-29 21:21:23 +00:00
Eric Petit 94b14b6271 Use file descriptors instead of streams (preliminary cleanup for fixes
to come in fdlimit*)
2006-04-23 17:03:12 +00:00
Eric Petit 6c0a54caa5 Update 2005-12-25 2006-01-12 18:58:57 +00:00
Eric Petit d2cc6ce7c6 Update 2005-11-17 2006-01-12 18:29:20 +00:00
Eric Petit a6aa884776 Import from 2005-10-26 2006-01-12 17:43:21 +00:00