1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-23 14:40:43 +00:00
Commit graph

55 commits

Author SHA1 Message Date
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
deea6fc6a2 Bring assertions closer to the beginning of blocks 2017-06-13 07:44:09 +03:00
Mike Gelfand
98695fe3c1 Introduce our own assertion macros with finer control 2017-06-08 10:24:12 +03:00
Mike Gelfand
5f7bc801c8 Make use of new checking capabilities in unit tests 2017-05-30 20:56:12 +03:00
Mike Gelfand
437904198e Transform check_uint_eq into generic check_uint (libtest) 2017-05-30 17:51:50 +03:00
Mike Gelfand
9c3c6f11e0 Transform check_int_eq into generic check_int (libtest) 2017-05-30 17:51:50 +03:00
Mike Gelfand
14c30119d4 Transform check_str_eq into generic check_str (libtest) 2017-05-30 17:51:46 +03:00
Mike Gelfand
341b778099 Continue running other test-cases even if one fails (libtest) 2017-05-30 17:44:51 +03:00
Mike Gelfand
7a238e7c65 Rename check_streq to check_str_eq to be in line with other macros (libtest) 2017-05-30 17:44:42 +03:00
Mike Gelfand
1e3d20422a Reduce for loop variables scope 2017-05-14 01:38:31 +03:00
Mike Gelfand
a762c770f2 Make conditional expressions explicitly boolean 2017-04-30 19:26:01 +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
0ac657c5f1 Fix up rename test to avoid random use-after-free failures 2016-12-25 19:44:38 +03:00
Mike Gelfand
3cda09ea81 Fix up rename test to avoid random duplicate torrent failures 2016-12-24 21:24:50 +03:00
Mike Gelfand
2248d3670f Get rid of $Id$ SVN keywords in source files 2016-09-02 23:10:15 +03:00
Jordan Lee
5fbd24fda5 fix a handful of minor compiler warnings, mostly in the unit tests, eg field width shortening or implicit signed/unsigned conversions 2016-03-29 03:04:54 +00:00
Mike Gelfand
c955c04d8f Explicitly compare result of str(n)cmp/memcmp to signify that it's not boolean 2016-03-13 22:11:01 +00:00
Mike Gelfand
3b129a72d8 #5908: Check for tr_loadFile return value instead of errno in tr_variantFromFile
Seems like there could be a defect in uClibc making errno not
thread-local. Don't rely on errno value but check function return value
instead which is a better failure indicator.

Return errors from `tr_loadFile` and `tr_variantFromFile` via tr_error.
Fix `tr_sessionLoadSettings` to not fail on Windows if settings.json
does not exist.
2015-04-11 10:51:59 +00:00
Mike Gelfand
440f482d01 Replace tabs with spaces; remove trailing spaces 2015-01-02 11:15:31 +00:00
Mike Gelfand
52a9d774e4 Fix compilation on Windows
This should not affect non-Win32 platforms in any way.
As for Win32 (both MinGW and MSVC), this should hopefully allow for
unpatched compilation. Correct functioning is not yet guaranteed though.
2014-12-13 15:22:39 +00:00
Mike Gelfand
1560ebd3ff Fix small memory leaks in crypto (base64) and rename (multi-file torrent) unit tests 2014-12-07 10:42:12 +00:00
Mike Gelfand
5c43b5c23c #4400, #5462: Move BASE64 helpers to crypto-utils
On a way to factoring out OpenSSL support to a standalone file to ease
addition of other crypto libraries support in the future, move helpers
providing BASE64 encoding and decoding to crypto-utils.{c,h}. OpenSSL-
related functionality is moved to crypto-utils-openssl.c.

Add new functions to be implemented by crypto backends:
* tr_base64_encode_impl - encode from binary to BASE64,
* tr_base64_decode_impl - decode from BASE64 to binary.

Change `tr_base64_encode` and `tr_base64_decode` functions to expect
non-negative input data length which is considered real and never adjusted.
To process null-terminated strings (which was achieved before by passing 0
or -1 as input data length), add new `tr_base64_encode_str` and
`tr_base64_decode_str` functions which do not accept input data length as
an argument but calculate it on their own.
2014-12-04 19:58:34 +00:00
Jordan Lee
0323639e57 (trunk, libT) #4160 'foreign character support' -- merge mike.dld's 4160-02b-path.patch, which updates the codebase to use the new tr_sys_path_*() portability wrappers introduced in 4160-02a 2014-07-08 00:08:43 +00:00
Jordan Lee
a2898f2ee9 (trunk, libT) #5656 'Problems renaming files' -- fixed, patch by rb07 2014-07-04 03:23:27 +00:00
Jordan Lee
db8a589ec4 add tr_makeMetaInfo() unit test for creating a single-file torrent 2014-06-08 20:01:10 +00:00
Jordan Lee
f17d152e2b separate out the sandbox code so that test sandboxes can be created without a tr_session 2014-06-08 19:09:41 +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
15d11de5f4 add svn:keywords on source files that were missing them 2014-01-19 01:29:38 +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
765879ddba silence a small handful of minor gcc compiler warnings in libtransmission 2013-08-17 17:03:15 +00:00
Jordan Lee
ba688e2811 silence a small handful of minor gcc compiler warnings in libtransmission 2013-08-17 16:31:03 +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
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
1a99b9c168 change the test harness' session initialization s.t. we can configure it for per-test needs. Add tests for moving completed torrents when downloadDir is a subdirectory of incompleteDir. (Hi, KyleK) 2013-02-01 05:57:47 +00:00
Jordan Lee
69f3e31230 (libT) change the API signature for tr_torrentVerify() s.t. client code can be notified when the verify is finished 2013-01-31 21:58:25 +00:00
Jordan Lee
1eb2933fc5 (libT) maybe fix removed-file-found issue reported by Lacrocivious 2013-01-31 19:07:34 +00:00
Jordan Lee
500aa4569f (libT) fix a filesystem sync issue in rename-test, reported by Lacrocivious 2013-01-31 18:20:37 +00:00
Jordan Lee
ae1ec6aab4 fix a race condition error in rename-test 2013-01-31 05:09:19 +00:00
Jordan Lee
0b9f651a93 (libT) add to rename-tests 2013-01-30 21:26:04 +00:00
Jordan Lee
722867ad62 (libT) tweaks to rename-test to give better line numbers on failure in Jenkins 2013-01-27 17:47:38 +00:00
Jordan Lee
388da24dd0 (libT) add package-visible API hook for when a block is downloaded. Add unit test to confirm that when the last file finishes downloading, its .part suffix is removed and it's moved from the incomplete to complete dir 2013-01-26 23:08:51 +00:00
Jordan Lee
06d9f20759 (libT) #1220 'change file and folder names': finish cleaning up the unit test for calling tr_torrentRenamePath() on an incomplete torrent with .part files 2013-01-23 22:53:58 +00:00
Jordan Lee
ee2e408288 (libT) rename-test tracers 2013-01-23 22:30:23 +00:00
Jordan Lee
a75f9394a6 (libT) rename-test tracers 2013-01-23 22:20:37 +00:00
Jordan Lee
beee17f9b2 (libT) more hacking on the rename + .part unit test 2013-01-23 22:10:40 +00:00
Jordan Lee
0daad8b7f6 (libT) fix red herring issue that tr_mkdirp() was setting errno even if the call succeeded. Add tests to confirm the fix. 2013-01-23 21:28:35 +00:00
Jordan Lee
5fb6ec36de continuation of previous commit to find out why Jenkins doesn't like the new rename unit tests 2013-01-23 20:59:20 +00:00
Jordan Lee
cd4543fe4c add temporary verbosity to the rename-test to coax log info out of Jenkins 2013-01-23 20:51:55 +00:00
Jordan Lee
ef2cb627f2 (libT) #1220 'change file and folder names': add a unit test for the r13837 bugfix of .part files + tr_torrentRenamePath() 2013-01-23 20:23:37 +00:00