Commit Graph

37 Commits

Author SHA1 Message Date
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
Jordan Lee e898374a48 (libT) #1220 'change file and folder names': add unit tests for renaming a root, then branch, then leaf in the torrent 2013-01-22 05:40:10 +00:00
Jordan Lee 77ecf6d08c (libT) #1220 'change file and folder names': add a test to confirm passing tor->info.name as the 'oldname' argument works 2013-01-22 05:06:38 +00:00
Jordan Lee 434bd6b287 (libT) #1220 'change top folder names' -- when the root file/folder is changed, update tr_info.name too. 2013-01-22 00:25:42 +00:00
Jordan Lee ac28b6df6e (trunk) move sandboxed session creation/teardown into libtransmission-test.[ch] so that it can be reused as a fixture by future tests 2013-01-20 04:41:38 +00:00
Jordan Lee 016f38f066 (trunk) #1220 'change top folder names' -- added support for this in libtransmission's C and RPC APIs. 2013-01-19 08:43:26 +00:00