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
a6d4bd35fc
Get rid of some more warnings
2015-12-29 00:42:40 +00:00
Mike Gelfand
4f266a5b15
Optimize URL-parsing functions a bit; rewrite tr_urlParse()
2015-12-28 23:52:26 +00:00
Mike Gelfand
4a4badd4af
Ongoing refactoring (use size_t instead of int)
2015-12-25 10:19:50 +00:00
Mike Gelfand
ceb19b9711
Optionally return result length from evbuffer_free_to_str()
2015-12-13 10:23:22 +00:00
Mike Gelfand
f6f15d6937
Use tr_realloc (BSD reallocf-alike) instead of plain realloc
2015-10-25 17:13:14 +00:00
Mike Gelfand
3d8c4c3960
Support absolute paths longer than ~260 chars on Windows
2015-10-23 05:29:47 +00:00
Mike Gelfand
7d972ed5e6
#6006 : Don't use newlocale/uselocale with uClibc below 0.9.34
...
Incomplete locale internals initialization in uClibc leads to crash upon
`newlocale` call.
See also: http://git.uclibc.org/uClibc/commit/?id=3902d0c472
2015-10-15 20:19:27 +00:00
Mike Gelfand
0420699ad6
Initialise networking in daemon before making libevent calls
2015-10-11 16:35:51 +00:00
Mike Gelfand
b89b90ee15
Avoid GCC 'static' is not at beginning of declaration
warning
2015-04-21 11:40:15 +00:00
Mike Gelfand
c1b10abe0f
Use UTF-8 for console I/O on Windows
2015-04-21 10:07:57 +00:00
Mike Gelfand
7bf402bb7d
Forward-declare tr_error
structure in headers
2015-04-11 14:54: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
cefc477918
Fix a couple more MinGW/MSVC warnings.
2015-03-19 19:13:23 +00:00
Mike Gelfand
4fe156a255
Fix tr_moveFile error reporting
...
Remove unused `renamed` argument.
Use tr_error instead of errno to report errors to support Win32 file
wrappers which do not map Windows error codes to POSIX ones.
Return bool instead of int (0/-1).
Uncomment tr_error_prefix and tr_error_propagate_prefixed functions.
2014-12-10 18:37:58 +00:00
Mike Gelfand
42de056a4b
#4400 , #5462 : Move SHA1/HEX 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 SHA1/HEX conversion to crypto-utils.{c,h}.
Rename functions:
* tr_sha1_to_hex -> tr_binary_to_hex (add length argument),
* tr_hex_to_sha1 -> tr_hex_to_binary (add length argument).
Make tr_sha1_to_hex and tr_hex_to_sha1 wrappers around above functions.
2014-12-04 20:53:56 +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
Mike Gelfand
13cad2fb55
#5722 : Rename remaining WIN32 uses to _WIN32
2014-11-30 20:08:20 +00:00
Jordan Lee
870041d92d
(trunk) #4160 : mike.dld patch: 4160-08-args.patch
2014-09-21 18:06:28 +00:00
Jordan Lee
be290162c2
(trunk) #4160 : mike.dld patch: 4160-07-env.patch
2014-09-21 18:05:14 +00:00
Jordan Lee
d9d66e3e42
(trunk, libt) #4160 - the slow slog to catch trunk up to mike.dld's 4160 diff continues. This step applies 4160-04b-dir.patch, which replaces native file operations with the tr_sys_dir_*() portability wrappers added in the previous commit.
2014-09-21 17:55:39 +00:00
Jordan Lee
c1beabfea6
(trunk, libT) #4160 'foreign character support' -- merge mike.dld's 4160-03a-file.platch, which introduces tr_sys_file_*() portability wrappers
2014-07-08 00:15:12 +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
Mitchell Livingston
0e01879974
Use built-in _WIN32 macro instead of WIN32
2014-07-04 00:00:07 +00:00
Jordan Lee
60a5c793d9
(trunk, libT) mike.dld's 4160-02a-path.patch: portability wrapper around file paths.
2014-07-03 21:58:39 +00:00
Mitchell Livingston
084273c106
Use built-in __APPLE__ macro instead of SYS_DARWIN and MACOSX
2014-07-03 19:20:12 +00:00
Jordan Lee
92daae473e
mike.dld's portability improvements to libtransmission, pt 1
2014-06-23 02:38:53 +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
0e453bb873
(trunk, libT) improved/new MSVC portability wrappers dirname, basename, gettimeofday(). patch by mikedld, breakage by charles
2013-09-08 18:27:27 +00:00
Jordan Lee
cd09204a6e
(trunk) first draft of changing the FreeSpace API to behave as https://trac.transmissionbt.com/ticket/4076#comment:25 -- libT, rpc, qt, and gtk implementations.
2013-02-09 04:05:03 +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
f75027d5e9
make all the log functions/structs/enums use a single 'tr_log' namespace, such as tr_logGetQueue, tr_logAddInfo, tr_logIsLevelActive
2013-01-25 23:34:20 +00:00
Jordan Lee
25b8b60245
(trunk, libT) #5199 'tr_sessionGetNextQueuedTorrent() can be faster' -- copy peer-mgr.c's partial-sorting peer candidate code to a reusable function in utils.c, tr_quickfindFirstK()"
2012-12-28 20:07:50 +00:00
Jordan Lee
e96ed247fe
refactor libtransmission's tr_benc class as tr_variant.
2012-12-14 04:34:42 +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
e5304a8aaa
make tr_mkdir() private.
2012-10-16 03:13:05 +00:00
Jordan Lee
bb49ab9a01
in torrent-magnet.c and utils.h, use tr_torrentName() instead of tor->info.name
2012-10-16 02:48:26 +00:00
Mitchell Livingston
723d681b63
Whoops! Revert new changes committed in r13469
2012-09-06 03:23:50 +00:00
Mitchell Livingston
9e7e64fe04
Revert r13468 for now.
2012-09-06 03:21:03 +00:00
Jordan Lee
f55ab8dddb
(trunk libT) move torrent.c's private function fileExists() to the utility function tr_fileExists() so that it can also be used by stats.c
2012-07-01 03:05:36 +00:00
Jordan Lee
42997e4102
don't use the word 'template' as a variable name, since it's a reserved word in C++
2011-11-12 00:16:04 +00:00
Jordan Lee
b3d382874a
(trunk libT) #4625 "Transmission 2.42 fails to build on Solaris 10: Undefined symbol 'mkdtemp'" -- fixed.
2011-11-10 03:31:43 +00:00
Jordan Lee
ae972b50c4
utils.h's public function tr_realpath() function relies on the private constant TR_MAX_PATH. Make TR_MAX_PATH public.
2011-10-25 15:57:10 +00:00
Jordan Lee
949241a490
(trunk libT) tr_set_func is only used in one place, so make it a private function there instead of leaving it public in utils.h
2011-03-22 23:49:29 +00:00
Jordan Lee
48212fa0b9
(trunk libT) tr_strtruncd() is only used in one place, so make it a private function there instead of leaving it public in utils.h
2011-03-22 23:46:31 +00:00
Jordan Lee
14277760d7
(trunk libT) tr_set_compare() is only used in one place, so make it a private function there instead of leaving it public in utils.h
2011-03-22 23:42:25 +00:00
Jordan Lee
503035fa7e
(trunk) remove unused gcc symbol: TR_GNUC_PURE
2011-03-22 23:37:20 +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
30f8f499ed
(trunk libT) move the single-use utility function "evbuffer_ref_cleanup_tr_free()" from a public header into a private function to limit its visibility/scope
2011-03-16 17:42:32 +00:00
Jordan Lee
3cfef5eded
(trunk libT) #117 "UDP tracker protocol support" -- working implementation; needs testing and valgrinding and review.
2011-03-13 00:18:11 +00:00
Jordan Lee
2b8124d3ad
(trunk) #4019 "Minor patch, kill useless casts in transmission source." -- fixed. patch by jlouis
...
jlouis used Coccinelle to scan transmission's source for redundant code that casts a type to its own type.
2011-02-12 17:27:47 +00:00
Jordan Lee
5d15ee8439
(trunk) #3949 "Add --enable-lightweight argument to configure" -- fixed.
...
TR_EMBEDDED has been around for awhile, but few (any?) repackagers are aware of it. If it was "advertised" through a configure-time argument, and in the status messages at the end of the configure script, more repackagers would be aware of it.
2011-01-27 03:53:02 +00:00
Jordan Lee
06884387da
(trunk) #3914 "strlsize() passes variable of incompatible type to the tr_formatter_size_B()" -- fixed.
2011-01-19 18:14:01 +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
b223a33b73
(trunk libT) fix crash reported by KyleK
2011-01-03 03:01:12 +00:00
Charles Kerr
21ca9e7770
(trunk libT) since messageLevel is a global variable, giving it a unique "tr_" prefix is a nice safeguard
2010-12-31 01:30:35 +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
81cb2276c8
(trunk gtk) #3844 "error popup when adding a relative path" -- fixed. initial patch by ijuxda.
2010-12-22 07:04:11 +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
a16fb94756
(trunk libT) #3813 "libtransmission doesn't build on Solaris 10 because of strsep call()" -- fixed.
2010-12-08 14:57:34 +00:00
Charles Kerr
8d15c48a3f
(trunk libT) #3617 "1000+ warnings of 'inlining failed' in libtransmission when compiled with gcc 4.4.4" -- fixed.
2010-10-11 15:41:27 +00:00
Charles Kerr
599c5a8cc4
(trunk daemon) #3511 , part 2 of 2: get rid of the TR_DEBUG environment variable
2010-09-22 15:17:16 +00:00
Charles Kerr
4d7046fd67
(trunk) #3547 "Wrong speed display in web UI" -- fixed
2010-09-18 23:06:03 +00:00
Daniel Lee
ac53f4792f
switch trackerRemove and trackerReplace rpc calls to use tracker id instead of announce urls as identifiers
2010-09-14 06:23:48 +00:00
Charles Kerr
2d5ac5b150
(trunk libT) add a string length argument to tr_urlIsValid()
2010-08-21 12:47:28 +00:00
Charles Kerr
6f5c9dcafb
(trunk libt) rename tr_date() as tr_time_msec() for clarity
2010-07-11 20:49:19 +00:00
Charles Kerr
52c04a0d06
(trunk) some units formatter cleanup.
2010-07-09 20:53:38 +00:00
Charles Kerr
91d8cbc383
(2.0x trunk) #3397 "checksum errors when downloading files whose names are encoded in iso-8859-1" -- fixed
2010-07-07 16:48:23 +00:00
Charles Kerr
88c61f8cc2
(trunk) #3045 fix oops from last commit
2010-07-06 20:52:54 +00:00
Charles Kerr
6e5af03d78
(trunk) #3045 "speed units" -- change the public API of libtransmission based on feedback from livings
2010-07-04 06:07:21 +00:00
Charles Kerr
cdcc4705aa
(trunk) #3045 "make libtransmission's API byte-oriented instead of KiB-oriented." -- implemented. This is a largish commit and will break the mac build for a little while.
2010-07-03 00:25:22 +00:00
Charles Kerr
a5a1f38393
(trunk libT) fix more issues found by -Wconversion
2010-07-01 05:14:34 +00:00
Charles Kerr
4a9e36e842
(trunk libT) #3381 "replace calls to usleep() with calls to nanosleep()" -- done.
2010-07-01 03:59:06 +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
d9e4ca49b5
(trunk) avoid a few unnecessary type conversions. remove a few unnecessary mutex locks.
2010-06-30 06:03:55 +00:00
Charles Kerr
1f3ead026d
(trunk) #3311 "MingW build of Transmission" -- modify tr_strip_positional_args() to strip out the ' printf flag. Platforms not supporting $ tend to not support ' either
2010-06-25 01:13:35 +00:00
Daniel Lee
bbe9e9843a
#3298:Prettier formating of percentages
2010-06-22 22:30:58 +00:00
Charles Kerr
e6cf296a68
(trunk libT) add an accessor for the formatter unit strings
2010-06-22 13:34:46 +00:00
Charles Kerr
1d63aa4cda
(trunk) add tr_formatter_size() and tr_formatter_speed() so that all the client apps don't have to reinvent the wheel
2010-06-22 04:34:16 +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
0ad06c50e8
(trunk) #3262 "problems with '.' as the first character in a .torrent's filename" -- fixed in trunk for 2.00
2010-06-07 14:25:31 +00:00
Charles Kerr
74216be9df
(trunk libT) "transmission.h" should *always* be #included before any other libtransmission header
2010-04-23 16:36:16 +00:00
Charles Kerr
7d7529eb94
(trunk libT) make tr_updateTime() inlined
2010-03-12 19:24:45 +00:00
Charles Kerr
c615514944
(trunk libT) add a wrapper function tr_valloc() to try posix_memalign(), getpagesize(), valloc() etc
2010-02-23 06:06:45 +00:00
Charles Kerr
5a9a07b71e
(trunk) #2938 "crash when adding a torrent by URL from an ftp source over RPC" -- fixed in trunk for 1.91
2010-02-20 15:57:05 +00:00
Mitchell Livingston
205b21dca3
add a convenience function for determining if an address is an IP address, and when picking a favicon in the Mac UI's tracker tab, use the full IP address when applicable
2010-02-01 23:52:46 +00:00
Charles Kerr
a334b422c3
(trunk) remove unnecessary #includes
2010-01-28 13:33:40 +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
0d91f3cadf
(trunk libT) more documentation and doxygen markup
2010-01-06 00:18:33 +00:00
Charles Kerr
182cbb8b90
(trunk) one of the less-interesting commits in a while: remove trailing spaces from lines
2010-01-05 23:47:50 +00:00
Charles Kerr
5c26afdb52
happy new year!
2010-01-04 21:00:47 +00:00
Charles Kerr
283b6d6a36
(trunk libT) rename tr_wait() tr_wait_msec()
2010-01-01 22:30:36 +00:00
Charles Kerr
e61e0fcd3d
(trunk libT) improved API documentation / commenting for doxygen
2010-01-01 22:13:27 +00:00
Charles Kerr
ac202f13bb
(trunk libT) remove dead code -- tr_assert()
2009-12-28 23:11:26 +00:00
Charles Kerr
ed1df8beac
(trunk libT) removed dead code: tr_isTimeval(), tr_timevalMsec(), tr_timevalSet()
2009-12-12 01:05:29 +00:00
Charles Kerr
0f14f62ac1
(trunk libT) new utility function tr_timerAddMsec()
2009-12-10 19:04:10 +00:00
Charles Kerr
78ead8c3dd
(trunk) update the copyright notices
2009-12-05 02:19:24 +00:00