Commit Graph

195 Commits

Author SHA1 Message Date
Jordan Lee d6e39e4d2f (trunk libT) #4284 "crash via webfrontend or transmission-remote" -- use patch from jerwied 2011-05-27 23:28:40 +00:00
Jordan Lee c061390f65 (trunk libT) heap pruning: using the same mechanism as in r12388, avoid an unnecessary malloc+memcpy+free in tr_bencToFile() 2011-04-27 21:33:52 +00:00
Jordan Lee c9b54799e3 (trunk libT) tweak the ABI of tr_bencToBuf() to match the way it's being used 2011-04-27 21:22:08 +00:00
Jordan Lee 0d593d3254 (trunk libT) fix "dangerous pointer arithmetic" warning detected by clang static analyzer 2011-03-31 04:24: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 374ed10f3b (trunk) it's bad form to #include so many system headers in libtransmission/utils.h... 2011-03-16 18:04:23 +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 ce08e00e2e (trunk libT) #3975 "tr_bencToFile() contains unnecessary calls to stat() and unlink()" -- fixed for win32.
remove() doesn't have the same behavior on Windows. On that platform, we should use MoveFileEx( oldpath, newpath, MOVEFILE_REPLACE_EXISTING )." Thanks to rb07 for testing & confirming the fix.
2011-02-06 18:56:44 +00:00
Jordan Lee deac8fedbe (trunk libT) now that bencode.c doesn't call stat() anymore, we can remove a couple of #includes 2011-02-03 06:19:54 +00:00
Jordan Lee 3282e1ea81 (trunk libT) #3975: "tr_bencToFile() contains unnecessary calls to stat() and unlink()" -- fixed.
When saving a tr_benc object to disk at $dst, bencode.c saves it to a tmp file in the same directory as $dst, unlinks $dst if it exists, and then renames $tmp as $dst. This commit removes the middle step, which is unnecessary because rename() has guarantees about atomically overwriting $dst.
2011-02-03 00:48:05 +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 ee849ab82b (trunk libT) #3956 "tr_bencFree() could be faster" -- fix memory error.
#3956's r11780 has uncovered a longstanding memory error that occurs when tr_bencParse() fails to parse a dict and leaves a dangling key. This is fixed by cleaning up the key.
2011-02-01 17:56:19 +00:00
Jordan Lee 56a81ab172 (trunk libT) #33956 "tr_bencFree() could be faster" -- fixed.
benc requires its dictionaries to be represented in a sorted form, so we sort them before walking across the entries. However that's overkill when all we're doing is freeing memory, so this commit adds a mechanism in the benc walker to optionally avoid the sorting overhead.
2011-01-29 18:14:35 +00:00
Jordan Lee 53f7fbb039 (trunk libT) #3927 "Use of libevent2 evbuffer_write on files..."
evbuffer_write() is intended for sockets. It works for files on Unix, but not on Windows, so we can't portably use it on files. Instead, use evbuffer_pullup() + write().
2011-01-22 13:33:05 +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
Charles Kerr 770ab426f6 (trunk libt) #3859 "Transmission unnecessarily writes .resume messages to Console Logs" -- fixed. 2010-12-29 04:54:06 +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 e8c2f6cf15 (trunk libT) #3836 "libevent2 support" -- optimize serialization of json strings for libevent2's new evbuffer API. This also fixes #3843 2010-12-21 22:07:15 +00:00
Charles Kerr 345b14adbc (trunk) #3836 "libevent2 support" -- bump libevent2 requirement to 2.0.10. This will break the Mac build for a minute intil BMW applies his Mac patch 2010-12-20 02:07:51 +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 2ce03097ee (trunk libT) #3781 -- remove excessive bencode debug messages. 2010-12-01 04:54:18 +00:00
Charles Kerr a9e740cb2c (trunk libT) #3678 "benc walking could be more efficient" -- fixed. 2010-10-26 19:30:35 +00:00
Charles Kerr 0cf643f8c3 (trunk libT) #3614 "Can't save benc files under uClibc 0.9.31" -- on some systems, calling unlink() on a file that doesn't exist returns 0 instead of -1 + ENOENT... so don't rely on that test. Instead, call stat() before unlink()ing the file. 2010-10-11 21:27:31 +00:00
Charles Kerr 865d9d7a34 (trukn libT) call tr_close_file() instead of close() after saving a benc file to disk 2010-09-29 02:38:14 +00:00
Charles Kerr 6d445f29eb (trunk libT) #3462 "minor json formatting optimization: omit unnecessary floating-point precision" -- done. 2010-07-31 14:45:07 +00:00
Charles Kerr 254a1f15cb (trunk libT) down the rabbit hole: various minor type correctness changes unearthed by -Wconversion 2010-06-30 16:40:19 +00:00
Charles Kerr 5ad7ed550f (trunk) more win32 fixes from rb07 in #3311 2010-06-22 00:12:52 +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 eda211e5ce (trunk) #2983: add command-line utilities for creating .torrent files, for editing passkeys, for adding/removing trackers, etc. 2010-06-16 14:27:24 +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 5d272161ed (trunk libT) fix bencode.c cross-compile error on arm-based NAS reported by nahkiss. This bug was introduced in a patch to fix #3172 and was added to trunk with r10549 and 1.9x/ with r10549 2010-05-05 16:03:33 +00:00
Charles Kerr 31f4d24004 (trunk libT) #3172 "transmission overwrites settings.json" -- fixed with kklimonda's patch for 2.00 2010-04-29 18:56:34 +00:00
Charles Kerr 9c94512672 (trunk libT) don't escape the '/' character in json strings 2010-04-25 15:30:50 +00:00
Charles Kerr 539f0edaba (trunk libT) in tr_bencToFile(), call fsync() before close() for better ext4 safety 2010-03-09 22:59:14 +00:00
Charles Kerr 7e28c375c9 (trunk libt) when generating json/benc strings, preallocate some space in the evbuffer to avoid excess realloc()s 2010-02-11 00:53:50 +00:00
Charles Kerr 168770f508 (trunk libT) #2716 "magnet torrents not being saved after quit" -- fix bencode bug. 2010-02-03 14:31:12 +00:00
Charles Kerr 36d97610bd (trunk) #2802, #2716, #2717 -- remember magnet links and their settings between sessions, and allow their trackers to be modified 2010-02-02 22:45:22 +00:00
Charles Kerr 42f63a63d3 (trunk libT) #2505 "Transmission loses config when disk is full" -- better implementation than r10068's from suggestions by elbandi 2010-02-02 01:05:27 +00:00
Charles Kerr 8f0f6679aa (trunk libT) #2505 "Transmission loses config when disk is full" -- implemented in trunk for 1.90 2010-02-01 21:09:31 +00:00
Charles Kerr 1c8426cfee (trunk libT) fix some #include statements 2010-01-20 23:58:09 +00:00
Charles Kerr 9eb07e9b16 (trunk) No code changes here... filling in some of the blanks in the "peers" and "utils" doxygen groups' documentation. 2010-01-19 19:37:00 +00:00
Charles Kerr 5c26afdb52 happy new year! 2010-01-04 21:00:47 +00:00
Charles Kerr 6b8fb48d64 (trunk libT) replace the TR_INLINE macro with the standard "inline" keyword, since we require inline functions anyway 2010-01-01 22:26:35 +00:00
Charles Kerr 78ead8c3dd (trunk) update the copyright notices 2009-12-05 02:19:24 +00:00
Charles Kerr 6d008257c8 (trunk libT) minor tweaks: make bencode's int parser code more consistent; make some comments more readable 2009-12-02 15:16:29 +00:00
Charles Kerr 515a3f986f (trunk, libT) fix code in the UTF8-to-JSON serializer that could fall into an infinite loop when fed some inputs. This may be ticket #2326 or may get its own retroactive ticket, depending on feedback from #2326's reporter 2009-09-02 15:26:34 +00:00
Charles Kerr bf1a544939 (trunk) all this commit does is remove trailing whitespace from some c, c++, and javascript source 2009-08-12 14:40:32 +00:00
Charles Kerr 723cabb542 (trunk libT) prevent potential rounding errors when sending floating-point numbers across the wire in json form 2009-08-03 23:18:02 +00:00
Charles Kerr 69bbff4d92 (trunk libT) fix a couple of minor gcc warnings 2009-07-17 18:00:29 +00:00