Dmytro Lytovchenko
43d1ece562
C++ modernization: Replace NULLs with typesafe nullptrs ( #1799 )
...
Fixing CI errors and build errors
Reverted changes: NULL in EV_SET macro; Clang-formatting
Reverted changes: MacosX *.m files reverted from master
2021-09-14 19:18:09 -05:00
Mike Gelfand
db3d40d0ed
Switch to clang-format for code formatting, include Mac client
2021-08-16 00:38:29 +03:00
Charles Kerr
a4dd67ae45
chore: fix some fixmes ( #1449 )
...
* chore: remove assertions that were flagged for removal
* chore: remove unneeded check
* refactor: move tr_peerIoAddrStr to net.h
* refactor: formatter API now takes size_t args
* chore: remove out-of-date FIXME comment
* refactor: cleanup logging win32 ifdefs
2020-09-13 16:43:29 -05:00
Charles Kerr
677dc73eac
refactor: use GTest for running tests ( #1383 )
...
* refactor: use google-test on libtransmission tests
2020-08-11 13:11:55 -05:00
Mike Gelfand
82df3a87f4
Update to Uncrustify 0.68.1
...
Tweak a few rules in the process. Now all code in cli, daemon, gtk,
libtransmission, qt, and utils is properly formatted with no manual
intervention.
2019-02-15 09:21:48 +03:00
Mike Gelfand
5b29fe1556
Ensure include guard is the first non-comment line
2017-11-14 23:21:28 +03:00
Mike Gelfand
18aabdeb06
Introduce peer socket struct to improve readability
2017-06-28 18:50:05 +03:00
Mike Gelfand
98695fe3c1
Introduce our own assertion macros with finer control
2017-06-08 10:24:12 +03:00
Mike Gelfand
a762c770f2
Make conditional expressions explicitly boolean
2017-04-30 19:26:01 +03:00
Mike Gelfand
4f9d9ad92b
Code style change leftovers
...
For some reason, GTK client wasn't fully processed. All the rest of changes
are mostly in comments.
2017-04-21 10:40:57 +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
2248d3670f
Get rid of $Id$ SVN keywords in source files
2016-09-02 23:10:15 +03:00
Jordan Lee
1af60ad6ad
use '#pragma once' instead of #ifndef..#define..#endif guards
2016-03-29 16:37:21 +00:00
Mike Gelfand
949e02b933
Define and use tr_socket_t and TR_BAD_SOCKET instead of int and -1.
...
Test socket validity by comparing to TR_BAD_SOCKET instead of various
(and sometimes wrong) other tests like `x >= 0`, `x != -1`, `x > 0`,
`x > -1`, `x` (valid), and `x < 0`, `x == -1` (invalid).
2015-03-18 07:34:26 +00:00
Mike Gelfand
e30728367f
#5771 : Use true and false instead of 1 and 0 for bool variables (patch by ticamkq + additional fixes)
2014-11-30 19:38:47 +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
96691dd019
(libT) make the class hierarchy between tr_peer, tr_peerMsgs, and tr_webseed a little less ad-hoc
2013-02-04 16:23:33 +00:00
Jordan Lee
553bd58681
(libT) peer-mgr doesn't care about non-piece data being transferred, so don't notify it when it happens
2013-01-30 18:00:03 +00:00
Jordan Lee
cff58b1904
(trunk, libT) #5163 'typo in tr_peerIoSupportsUTP()' -- fixed.
2012-12-06 15:04: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
244bd7bc1c
(trunk libT) more heap pruning: use composition rather than aggregation for the tr_crypto object owned by tr_peerIo.
2011-04-17 05:22:50 +00:00
Jordan Lee
05b75e6e9f
(trunk libT) use a better data struct for the tr_datatype list in peer-io
2011-04-10 05:21:51 +00:00
Jordan Lee
525d854016
(trunk libT) when reading piece data in from a socket, avoid two unnecessary calls to memcpy()
2011-04-04 04:45:41 +00:00
Jordan Lee
65f0f3effd
(trunk libT) copyediting: peer-io's "EncryptionMode" type had a name too similar to tr_encryption_mode... rename it to reduce potential confusion
2011-03-31 16:41:52 +00:00
Jordan Lee
1b825079be
(trunk libT) API cleanup of the tr_address functions to make them more consistent.
...
This is loosely related to #2910 , but only in the sense of laying the groundwork for #2910 's fix...
2011-03-25 05:34:26 +00:00
Jordan Lee
f7005889d1
(trunk libT) copyediting: clean up the "#include <event2/*>" directives in libtransmission's header files
2011-03-24 22:45:04 +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
757dac11ef
(trunk libT) cpu load improvements based on profiling by gunzip
2011-03-15 18:11:31 +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
f00799f80c
if we successfully finish a handshake using uTP, mark the peer as supporting uTP
2011-02-18 00:41:06 +00:00
Juliusz Chroboczek
77c034122e
Revert "Maintain information about enabled/disabled I/O."
...
This reverts commit 604f8fd10db747e57d8710cc53326c0e114ad32c.
2011-02-18 00:36:24 +00:00
Juliusz Chroboczek
88f4eac81f
Implement outgoing uTP connections.
2011-02-18 00:36:19 +00:00
Juliusz Chroboczek
d347f5ada4
Maintain information about enabled/disabled I/O.
2011-02-18 00:36:07 +00:00
Juliusz Chroboczek
8599d7c037
Modify peer-io to work with UTP sockets.
...
This is not supposed to work yet -- it just adds new fields to the data
structures to get the UTP code to compile.
2011-02-18 00:23:51 +00:00
Jordan Lee
984ac1b92e
(trunk libT) fix compiler warning: "peer-io.h:282: warning: inlining failed in call to ‘evbuffer_add_uint8’: optimizing for size and code size would grow"
2011-02-09 02:35:16 +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
Jordan Lee
007b96a62f
(trunk libT) #3894 "tr_peerIo.hasFinishedConnecting should be removed" -- committed.
2011-01-13 01:58:57 +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
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
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
f29cda25bc
(trunk libT) remove unnecessary calls to time(NULL)
2010-10-08 13:36:33 +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
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
8433e0dd3b
(trunk libT) make tr_peerIoEnable*() inline functions
2010-05-20 15:30:18 +00:00
Charles Kerr
4f5670f9c0
(trunk libT) #2842 "Transmission crashes randomly on ARM-based Synology NAS" -- experimental commit based on giovannibajo's suggestion in comment:39 about the list struct's alignment
2010-04-23 23:45:44 +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