Commit Graph

51 Commits

Author SHA1 Message Date
Mike Gelfand db3d40d0ed Switch to clang-format for code formatting, include Mac client 2021-08-16 00:38:29 +03:00
Charles Kerr 677dc73eac
refactor: use GTest for running tests (#1383)
* refactor: use google-test on libtransmission tests
2020-08-11 13:11:55 -05:00
Mike Gelfand 99033b067d Sanitize suspicious path components instead of rejecting them
Apply the same rules on all the supported platforms to avoid issues
with network shares and alien file systems.

For future compatibility, explicitly mark adjusted paths as renamed.

Fixes: #294
2019-06-23 18:08:31 +03:00
Mike Gelfand 5b29fe1556 Ensure include guard is the first non-comment line 2017-11-14 23:21:28 +03:00
Mike Gelfand bb4741002f Go back to using hash as base name for resume and torrent files
The format introduced in TRAC-394 is nice but brings its own issues (e.g.
TRAC-4189, #122). I'm okay with a bit of grepping myself if it makes the
experience better for end users.

Using hashes results in filenames well under 255 bytes limit on some
filesystems. If even that will not be enough, I'd suggest reporting the
issue elsewhere.

Fixes: #122
2017-07-26 21:32:26 +03:00
Mike Gelfand dadffa2c0f Align type qualifiers to the right (code style)
This way all the qualifiers (`const`, `volatile`, `mutable`) are grouped
together, e.g. `T const* const x` vs. `const T* const x`. Also helps reading
types right-to-left, e.g. "constant pointer to constant T" vs. "constant
pointer to T which is constant".
2017-04-20 19:53:20 +03:00
Mike Gelfand d7930984ef Adjust uncrustify config, reformat all but Mac client
There're places where manual intervention is still required as uncrustify
is not ideal (unfortunately), but at least one may rely on it to do the
right thing most of the time (e.g. when sending in a patch).

The style itself is quite different from what we had before but making it
uniform across all the codebase is the key. I also hope that it'll make the
code more readable (YMMV) and less sensitive to further changes.
2017-04-20 10:01:22 +03:00
Mike Gelfand 2248d3670f Get rid of $Id$ SVN keywords in source files 2016-09-02 23:10:15 +03:00
Jordan Lee 1af60ad6ad use '#pragma once' instead of #ifndef..#define..#endif guards 2016-03-29 16:37:21 +00:00
Mike Gelfand 3523277e7f Ongoing refactoring (use size_t instead of int) 2015-12-25 11:34:35 +00:00
Jordan Lee 02cff80c2d Copyedit the license's revised text: (1) remove unnecessary repitition use of the word 'license' from the top of the header and source files (2) add the standard 'we hope it's useful, but no warranty' clause to COPYING (3) make explicit that linking OpenSSL is allowed (see https://people.gnome.org/~markmc/openssl-and-the-gpl.html for background) (4) sync the Qt and GTK+ clients' license popups with COPYING's revised text 2014-01-21 03:10:30 +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 e96ed247fe refactor libtransmission's tr_benc class as tr_variant. 2012-12-14 04:34:42 +00:00
Jordan Lee 410fa7e054 remove unused function tr_metainfoMigrate() 2012-12-09 01:27:01 +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 b4d36aeb54 (trunk) #4138 "use stdbool.h instead of tr_bool" -- done. 2011-03-22 15:19:54 +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 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 13b073fcdc (libT) #3291 "tr_torrent.infoDictOffset should be lazily evaluated" 2010-06-16 03:05:23 +00:00
Charles Kerr 3682466488 (trunk libT) #3136 "slashes in magnet names" -- fixed in trunk for 2.00 2010-04-20 23:14:00 +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 5c26afdb52 happy new year! 2010-01-04 21:00:47 +00:00
Eric Petit 5fb945653f #2673 crash in tr_torrentGetMetadataPiece 2009-12-15 15:19:08 +00:00
Charles Kerr 907c67ba78 (trunk libT) remove unnecessary #includes 2009-12-07 03:57:55 +00:00
Charles Kerr f69e335291 (trunk) #2096: Magnet, BEP #9 support 2009-11-24 02:16:31 +00:00
Charles Kerr 1c3b53244d (trunk) clean up the return value of tr_torrentParse() 2009-08-05 01:59:16 +00:00
Charles Kerr d0ae679a2f (trunk) minor commit: sync the .h licenses with their counterpart .c licenses 2009-06-06 17:39:04 +00:00
Charles Kerr 788b397ecc (trunk libT) more semantic cleanup: tr_handle->tr_session, int->tr_bool, int->tr_port 2008-12-14 11:21:11 +00:00
Charles Kerr a1cd6d85dc (libT) add #ifdefs to ensure that client apps don't #include private libtransmission headers. 2008-11-24 20:17:36 +00:00
Charles Kerr 7ec84486ee (libT) more win32 portability fixes from Spry 2008-10-20 19:34:19 +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 e4f6b9592d get tr_ctorSetMetainfoFromHash() working again. 2008-04-14 14:39:13 +00:00
Charles Kerr afde752dc0 'resume' cleanup 2008-04-14 11:52:50 +00:00
Charles Kerr b71a2985b3 #684: Use XDG basedir spec for configuration and cache files in $HOME 2008-04-05 20:12:11 +00:00
Charles Kerr 8cc587a66f more housekeeping: benc_val_t --> tr_benc 2008-02-26 21:58:58 +00:00
Charles Kerr ce6c33b7bf set copyright info to 2008 2008-01-01 17:20:20 +00:00
Charles Kerr 16e273ed05 fix torrent parsing bug reported by m1b, SoftwareElves, and BentMyWookie 2007-12-25 01:23:07 +00:00
Charles Kerr b13d8d1dd6 save a copy of the torrent's metadata in tr_torrentInit(), not tr_torrentParse(). remove dead code from metainfo.c. 2007-12-22 18:00:47 +00:00
Charles Kerr 287975caf5 the torrent ctor is here. 2007-12-21 22:18:40 +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 8e401729cd Modified tr_torrentCanAdd() to give the new functionality BMW suggests 2007-06-27 14:54:31 +00:00
Josh Elsasser 7e03349f76 Merge r1634 to trunk. 2007-04-02 20:38:23 +00:00
Josh Elsasser 494ca91fd6 Append a frontend-specific tag to saved torrents.
This prevents one frontend from deleting a saved torrent used by another.
2007-03-13 06:56:50 +00:00
Eric Petit 7a6401c7b4 Split transmission.c: everything related to the accept/upnp/choking
thread was moved to shared.c
2007-01-19 04:42:31 +00:00
Mitchell Livingston 3374ce9a32 merge multitracker branch:
Adds announce list, support for code 301/302 redirect, improvements to mac inspector, better queueing with errors, random extra wait of up to a minute between announces, and other changes.
2006-12-17 16:36:27 +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
Josh Elsasser 0600f3d4aa Add support to libtransmission and the MacOS X GUI for saving private copies of
torrent files.
2006-06-09 19:53:35 +00:00
Eric Petit f98fe6a1b0 Added $Id$ keywords and updated a few headers 2006-05-29 21:21:23 +00:00