Commit Graph

88 Commits

Author SHA1 Message Date
Mike Gelfand 2e6d5c8bc9 Add more booleans to the picture 2015-05-31 22:13:31 +00:00
Mike Gelfand f6f7bf8227 #4400, #5462: Move random 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 random numbers/data generation to crypto-utils.{c,h}. OpenSSL-
related functionality (generation of cryptographically strong random
data) is moved to crypto-utils-openssl.c.

Rename functions to follow currently accepted style:
* tr_cryptoRandBuf -> tr_rand_buffer
* tr_cryptoRandInt -> tr_rand_int
* tr_cryptoWeakRandInt -> tr_rand_int_weak

Fix rare case of invalid value being returned from tr_rand_int. Return
value for abs(INT_MIN) may be undefined and thus negative, and so
tr_rand_int will return negative value which is incorrect (out of
requested and expected range).
2014-12-04 11:27:38 +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 ea7d2482dd introduce TR_PRIuSIZE macro for portable printf()ing of size_t. mikedld 2013-09-08 17:32:09 +00:00
Jordan Lee 28fe36f1f8 #include limits.h where we use it, and don't where we don't 2013-08-24 17:53:45 +00:00
Jordan Lee 0f1f84898b silence a small handful of minor gcc compiler warnings in libtransmission 2013-08-17 17:20:31 +00:00
Jordan Lee c8e22c46d4 (libT) #5267: 'speed limits wrap around too low number (~8589 kB/s)': patch by const 2013-02-02 16:31:05 +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 ad3407567b (libT) copyediting: modify more files to the new indentation/whitespace formatting 2013-01-24 23:59:52 +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 3398a48e57 (trunk libT) #4402 "Transmission Bandwidth allocation getting overflows" -- use gvdl's patch '4402-uint-bpsoverflow.patch' 2012-07-01 02:17:35 +00:00
Jordan Lee 4f1db26672 (trunk libT) bandwidth.c: minor phaseOne() improvements suggested by livings 2011-10-25 21:54:51 +00:00
Jordan Lee 82595e8ad8 (trunk libT) #4592 "Algorithm bug in bandwidth allocation" -- apply patch from Algorithmus 2011-10-25 16:56:19 +00:00
Jordan Lee 3778da6f82 remove dead code 2011-08-08 16:58:29 +00:00
Jordan Lee 2362580e0e (trunk libT) add a unique key to each tr_bandwidth object, so that when sorting them arbitrarily we can use that key rather than their pointer address. Apparently comparing pointers that aren't allocated in the same array is undefined behavior. 2011-06-19 18:34:10 +00:00
Jordan Lee ddaaa92c31 (trunk libT) make allocateBandwidth()'s "priority" field const. 2011-05-11 21:09:31 +00:00
Jordan Lee 3c3fda5c66 (trunk libT) CPU optimization in tr_bandwidthClamp().
Don't call tr_time_msec() if it's not necessary. This was one of the top CPU sinks in profiling, so removing it is a nice improvement in cases when it's not necessary, such as when speed limiting is disabled.
2011-05-09 04:16:49 +00:00
Jordan Lee f8f02fe7c3 (trunk libT) #2338 "Add uTP support" -- increase the block bandwidth to 3000 bytes in phase 1 as suggested by jch in comment:120.
The rationale is that by using 3000 bytes we'll send one full-size frame straight away, and leave enough buffered data for the next frame to go out in a timely manner.
2011-05-04 21:38:01 +00:00
Jordan Lee 9c3d12dae2 (trunk libT) changes to the bandwidth allocator's phaseOne step as suggested by Vincent in #2338 comment:108 2011-04-16 21:46:32 +00:00
Jordan Lee 1b02eb8641 (trunk libT) use aggregation for the tr_bandwidth objects owned by tr_session and tr_torrent 2011-03-31 14:53:22 +00:00
Jordan Lee 324f0f470c (trunk libT) copyediting: '#include "crypto.h"' cleanup 2011-03-25 01:21:31 +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 757dac11ef (trunk libT) cpu load improvements based on profiling by gunzip 2011-03-15 18:11:31 +00:00
Jordan Lee f9c6deab6f (trunk libT) minor revision to r12065: clamp the bandwidth before applying the ratio calculation 2011-03-03 07:20:18 +00:00
Jordan Lee 6e84fb89fa (trunk libT) work in progress, but this is a slightly better speed limiting for mixed tcp/utp peers 2011-03-02 07:21:58 +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 01ab067e9c (trunk libT) #3662 "libtransmission cpu optimization: fewer calls to tr_time_msec()" -- fixed. 2010-10-24 01:08:08 +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 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 7936f0d5d1 (trunk libT) clean up #includes for event.h and evutil.h 2010-05-19 16:17:51 +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 4322837189 (trunk) remove dead code 2009-11-23 21:57:10 +00:00
Charles Kerr 6ad33534e7 (trunk libT) tweak high/normal/low priority peer bandwidth allocation 2009-11-10 19:35:06 +00:00
Charles Kerr f92fd55a80 (trunk libT) add a couple more debugging assertions into the nightlies to try & smoke out the handshake/peer-io crashes 2009-10-09 20:06:22 +00:00
Charles Kerr 7c6fbfb80f (trunk libT) fix a couple of dead assignments, and a possible null pointer dereference, found by clang 2009-05-22 19:03:00 +00:00
Charles Kerr 114e6b3626 undo r8288 2009-04-25 19:22:27 +00:00
Charles Kerr 94c1b90fe1 (trunk libT) small bandwidth patch from wereHamster 2009-04-25 19:04:48 +00:00
Charles Kerr fb587a5b30 (trunk libT) make sure that outbound protocol messages don't get blocked by bandwidth limits 2009-04-21 16:18:51 +00:00
Charles Kerr 03fa0b3e7d (trunk) experimental support for tr_torrentSetPriority() 2009-04-18 23:17:30 +00:00
Charles Kerr dd00672517 (trunk libT) more experimental code for Biiaru 2009-01-24 16:21:34 +00:00
Charles Kerr 7f82b7172c (trunk libT) don't limit peer bandwidth during the handshake phase. this solves a bug that made it difficult to connect to peers when the upload bandwidth is saturated. 2009-01-24 03:17:59 +00:00
Charles Kerr 4d228289ce (trunk libT) prefer `int' over `ssize_t' 2009-01-19 14:05:43 +00:00
Charles Kerr 2f6b56671f (trunk libT) win32 portability patch from Alexey 2009-01-11 17:02:04 +00:00
Charles Kerr fe816d8135 (trunk) update the GPL code's copyright dates 2009-01-10 23:09:07 +00:00