Maciej Wolny
3a1730495d
Use strncmp instead of memcmp to avoid out-of-bounds reads
2016-10-05 16:19:31 +02:00
Mike Gelfand
2248d3670f
Get rid of $Id$ SVN keywords in source files
2016-09-02 23:10:15 +03: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
eb8fc35ac6
Remove useless checks and definitions (C99)
...
Now that MSVC support for C99 is quite good, remove previously needed but
now unused checks and definitions, like PRI* format macros (including
PRIdMAX and TR_PRIuSIZE, replaced with %jd and %zu) and inline macro.
Also, remove ssize_t typedef and replace few occurences with ev_ssize_t.
Also, remove check for stdbool.h availability (guaranteed by C99) and
include it unconditionally (except when in C++ mode).
2015-12-29 19:37:31 +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
2321bc3fad
Fix some issues revealed by coverity
2015-05-09 08:37:55 +00:00
Mike Gelfand
7879100c01
Cut internal macro names to have equal number of underscores on each side
2015-05-04 19:58:34 +00:00
Mike Gelfand
440f482d01
Replace tabs with spaces; remove trailing spaces
2015-01-02 11:15: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
98dd141449
correct function pointer type correctness. mikedld
2013-09-08 17:29:25 +00:00
Jordan Lee
605e2e89ad
use evutil_socket_t instead of int to define socket types. Patch my mikedLd :)
2013-09-08 17:03:11 +00:00
Jordan Lee
35638e210e
add inline wrapper functions to tr_torrent to decouple the rest of the code from tr_completion
2013-08-18 13:06:39 +00:00
Jordan Lee
db6fd6630d
tweak previous commit
2013-07-21 21:11:54 +00:00
Jordan Lee
4787364b1a
(trunk, libT) #5432 'on scrape and announce failures, the retry interval is longer than intended' -- fixed.
2013-07-21 21:10:28 +00:00
Jordan Lee
ee130e773d
(trunk, libT) #5395 : when announces fail, lower the period before the first retry to fix unspecified 'network problems'.
2013-07-16 00:13:30 +00:00
Jordan Lee
d4d2a04560
libT: undo r13901 regression to #4888 in the nightlies
2013-04-13 19:28:49 +00:00
Jordan Lee
1f2bccd17b
(libT) recycle the peer id used for public torrents after N hours of use
2013-02-02 13:42:50 +00:00
Jordan Lee
1b5cc093e6
(libT) when announcing a magnet link for the first time, send 'left=0'
2013-01-30 19:59:55 +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
399c3233b7
remove a couple of unnecessary torrentIsLocked() assertions for #5168
2012-12-12 20:57:13 +00:00
Jordan Lee
a2d2a10226
(trunk, libT) #5165 : fix r13625 oops
2012-12-07 01:53:31 +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
f226d8a03f
(trunk libT) #4914 if a tracker has no scrape URL but the announce response contains any scrape fields, that's as close to a scrape as we're going to get, so use those fields.
2012-05-22 20:21:00 +00:00
Jordan Lee
e9e76fa970
(trunk libT) #4888 : when scraping magnet links, don't send a left=0 argument to the tracker.
2012-05-20 14:14:59 +00:00
Jordan Lee
6948852013
(trunk libT) #4894 -- don't use evbuffer_add_printf() and evbuffer_pullup() together.
2012-05-17 17:40:31 +00:00
Mitchell Livingston
3eb8b12fa8
#4704 req->left = tr_cpLeftUntilComplete( &tor->completion ) should end with a semicolon
2012-01-11 22:31:02 +00:00
Jordan Lee
ed56cd1193
(trunk libT) #4526 "do not skip scrape unless all three scrape fields came with announce" -- add field initializers.
2011-10-14 00:27:14 +00:00
Jordan Lee
c9421c4041
(trunk libT) #4530 "lastAnnounceResult is not properly set" -- fixed.
2011-10-09 00:21:36 +00:00
Jordan Lee
bc4e3f137c
(trunk libT) #4526 "do not skip scrape unless all three scrape fields came with announce" -- fixed.
2011-10-09 00:18:18 +00:00
Jordan Lee
177f2398a5
(trunk libT) #4396 "Scrape requests not showing in logfile" -- when the announce response contains scrape information, add a log message saying that the next scrape has been rescheduled.
2011-08-14 14:45:54 +00:00
Jordan Lee
60f9191fdc
(trunk libT) modify announcer's scrape triggers as per discussion with Elbandi
2011-07-31 00:58:05 +00:00
Jordan Lee
3928a9d8e9
(trunk libT) #3219 "Don't scrape paused torrents" -- allow this as a 'hidden' option in settings.json, but don't add it to the GUI or to RPC.
2011-07-23 17:14:12 +00:00
Jordan Lee
b4ffdaac42
(trunk libT) #4277 "Checkmarks for leechers" -- possible fix.
...
It appears 2.30 and 2.31 might be making too many assumptions about which peers are seeds.
2011-06-25 19:29:25 +00:00
Jordan Lee
34642e7259
(trukn libT) lessen the importance of error messages returned by trackers in a multi-tracker torrent. It's all too often that people will load up a .torrent file with dozens of announce URLs, many of them dead...
2011-06-25 18:47:35 +00:00
Jordan Lee
bcf89fa9c3
(trunk libT) modify how the "stops" sorted container is used s.t. the container's uniqueness requirements are met.
2011-06-19 18:26:04 +00:00
Jordan Lee
50ceaafeb8
(trunk libT) very minor copyediting: remove a little unwanted whitespace
2011-04-30 00:08:24 +00:00
Jordan Lee
5681ea73e2
(trunk libT) heap pruning: avoid unnecessary malloc+memcpy+frees in announcer.
...
1. when creating announce URLs in announcer-http.c
2. when creating scrape URLs in announcer-http.c
3. when deep-logging what announces are in a torrent's queue in announcer.c
2011-04-27 20:41:47 +00:00
Jordan Lee
2043356876
(trunk libT) constify the tr_scrape_request argument to scrape_request_delegate().
2011-04-27 17:30:53 +00:00
Jordan Lee
96c180fd73
(trunk libT) fix 2.30b1 memory corruption bug when editing trackers.
...
The problem was that the new number of trackers was not being kept and the old count was retained. So if the count changed, tr_torrentTrackers() could return dangling pointers to the caller.
2011-04-11 19:44:16 +00:00
Mitchell Livingston
2b79fd7186
#4175 fix typo
2011-04-10 16:26:55 +00:00
Jordan Lee
e825bd66c7
(trunk libT) #4175 "very bizarre and unwieldly logfile in 2.30b2" -- fixed.
2011-04-10 14:15:52 +00:00
Jordan Lee
e2b7728637
6789ABCDE
2011-04-10 05:27:14 +00:00
Jordan Lee
9b96ced90a
(trunk libT) #4175 "very bizarre and unwieldy logfile in 2.30b2" -- another test commit for gunzip :)
2011-04-10 03:57:37 +00:00
Jordan Lee
42fbf1f646
(trunk libT) #4175 "bizarre and unwieldly logfile in 2.30b2" -- possible fix for gunzip to test
2011-04-10 00:05:18 +00:00
Jordan Lee
35eb016209
(trunk libT) use get_next_scrape_time() inside the scrape error handler.
...
get_next_scrape_time() was introduced in r12297. The rationale is that by rounding all scrape times to their nearest 10th second, they will tend to occur in batches and improve multiscrape.
2011-04-07 20:00:26 +00:00