Mike Gelfand
72f9dc6f92
#5992 : Remove now obsolete check for 13th Baktun (already happened)
2015-10-16 19:49:07 +00:00
Mike Gelfand
0420699ad6
Initialise networking in daemon before making libevent calls
2015-10-11 16:35:51 +00:00
Mike Gelfand
6cbfcdc85e
Fix tr_net_strerror
on Windows (oops)
2015-07-01 00:58:00 +00:00
Mike Gelfand
79195614b2
Use sockerrno
and tr_net_strerror
for most of network-related errors
...
This ensures proper network errors formatting on Windows.
Also, disable IP_TOS socket option modification attempts on Windows
since it's not supported there and is considered deprecated: "Do not
use. Type of Service (TOS) settings should only be set using the
Quality of Service API" (c) MSDN. Using QoS API is a subject for
separate commit(s).
2015-07-01 00:54:41 +00:00
Mike Gelfand
4a23c94252
Fix some issues revealed by coverity
2015-05-09 14:09:05 +00:00
Mike Gelfand
12095175a1
Do not return -EINVAL
as socket value (obviously not a good idea).
...
Also, fix socket descriptor leak in `tr_netBindTCPImpl` if `IPV6_V6ONLY` is defined.
2015-03-26 18:29:11 +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
9a3b965ce4
Kill some warnings when compiling on Windows
2015-01-02 04:02:13 +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
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
Mitchell Livingston
0e01879974
Use built-in _WIN32 macro instead of WIN32
2014-07-04 00:00:07 +00:00
Jordan Lee
5a2268289e
(trunk, libT) #5651 'int to bool patch' -- fixed, patch by rajmannugetr
2014-04-27 23:10:01 +00:00
Jordan Lee
6bcdd93e45
(trunk libT) #5318 : 'socket leak when bind() fails': fixed.
2013-04-13 19:34:34 +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
a2d2a10226
(trunk, libT) #5165 : fix r13625 oops
2012-12-07 01:53:31 +00:00
Jordan Lee
519feefcb4
(trunk, libT) #5157 -- fix r13628 oops
2012-12-06 00:50:40 +00:00
Jordan Lee
61c1f7efec
(trunk, libT) #5157 'check valid address before UTP_Create()' -- added.
2012-12-05 23:48:00 +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
d717248e75
(trunk libT) fix the Linux build wrt compiling with the new snapshot of libutp checked into r13317
...
Previously we made sure to include stdbool.h (via transmission.h) before utp.h, since the latter used 'bool' without defining it. The new snapshot defines it unconditionally in non-C++ code, so now we need to include it first.
2012-05-30 17:47:29 +00:00
Jordan Lee
2786136015
(trunk) #4490 "Transmission 2.40b1 fails to build: undefined references" -- fixed.
2011-10-08 23:53:27 +00:00
Juliusz Chroboczek
232075f547
Reinstate including tcp.h in net.c.
...
Removed in r12225, this broke netSetCongestionControl.
2011-04-02 16:43:17 +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
87ef45cf3d
(trunk libT) copyediting: remove a bunch of seemingly-unneeded network headers in net.[ch].
...
I'm less certain that these are unneeded because networking APIs seem to have more variation between platforms, but it's better to remove the cruft and then add back whatever headers $PLATFORM users complain about, than to not remove the cruft at all...
2011-03-24 22:57:39 +00:00
Jordan Lee
375694eda9
(trunk) copyediting: remove some unneeded #includes, and annotate some needed ones
2011-03-24 21:49:42 +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
cdff3aa090
(trunk libT) minor tweak: use evutil_closesocket() instead of the older EVUTIL_CLOSESOCKET() macro.
2011-03-13 19:47:21 +00:00
Jordan Lee
4a4842fea5
(trunk libT) use libevent2's portability wrappers for inet_ntop() and inet_pton().
...
We currently implement our own versions of these on mingw because that platform doesn't have them... but why reinvent the wheel; libevent has already done the same thing. Let's use libevent2's implementation.
has already done it for us.
2011-03-13 08:15:40 +00:00
Jordan Lee
9bf2434e14
(trunk) copyediting: remove trailing spaces from source code lines in daemon/ gtk/ libtransmission/ and utils/
2011-03-04 23:26:10 +00:00
Jordan Lee
3fdd80eb0d
(trunk libT) new function: tr_ssToAddr()
...
This handles converting the data in a sockaddr_storage to a tr_address + port, and removes redundant code from fdlimit.c and tr-udp.c that previously did this work.
2011-03-04 21:00:52 +00:00
Juliusz Chroboczek
e7fc697c90
Stub out UTP_Create in non-uTP builds.
2011-02-18 16:01:52 +00:00
Jordan Lee
cd04051de8
add configure script switch to enable/disable utp
2011-02-18 00:45:44 +00:00
Juliusz Chroboczek
88f4eac81f
Implement outgoing uTP connections.
2011-02-18 00:36:19 +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
a17962d5fc
(trunk libT) #3528 "TR_PREFS_KEY_BIND_ADDRESS_IPV4 breaks IPv6-only trackers" -- Implement suggestion #2 from Harry
2010-12-30 19:15: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
ae84dc70dd
(trunk libT) #3836 "libevent2 support" -- finish moving to the libevent2 API mode. don't include the backwards-compatable API headers.
2010-12-24 08:58:41 +00:00
Charles Kerr
b87826333c
(trunk libT) #3806 "logging error in net.c" -- fixed.
2010-12-08 17:22:00 +00:00
Charles Kerr
74cff042ea
(trunk libT) silence minor compiler warning
2010-10-14 17:03:04 +00:00
Charles Kerr
8b386a63b1
(trunk libT) #3311 "MingW build of Transmission" -- added rb07's revisions to my revisions to his diff. :P
2010-07-01 04:00:41 +00:00
Charles Kerr
954a309d8f
(trunk) #3311 "MingW build of Transmission" -- apply more of rb07's diffs, though edited to lessen the inevitable #ifdefs
2010-06-30 21:24:36 +00:00
Charles Kerr
98cec85e46
(trunk libT) #3311 "MingW build of Transmission" -- apply further win32 diffs from rb07
2010-06-25 20:36:10 +00:00
Charles Kerr
5ad7ed550f
(trunk) more win32 fixes from rb07 in #3311
2010-06-22 00:12:52 +00:00
Charles Kerr
3e7730e9b7
(trunk libT) remove a pair of unnecessary, but expensive, assert()s
2010-06-14 23:14:58 +00:00
Charles Kerr
00f452d942
(trunk libT) #3162 "allow optional end-user configuration of TCP_CONGESTION" -- add jch's implementation of this to trunk for 2.00
2010-04-22 01:49:16 +00:00
Charles Kerr
10fb49059f
(trunk libT) #3047 "Periodic disk access in idle state" -- added to trunk for 2.00 by committing a patch by klapaucjusz into this svn code repository
2010-04-20 03:44:45 +00:00
Charles Kerr
fe3d9ed95a
(trunk) one of the least interesting commits ever: remove trailing spaces from source code lines...
2010-03-17 17:07:40 +00:00
Charles Kerr
5a69330344
(trunk libT) when we can't bind to a port and the error is EADDRINUSE, add a parenthetical hint "(Is another copy of Transmission already running?)"
2010-02-06 14:43:28 +00:00
Charles Kerr
02ffbe75e4
(trunk libT) #2778 "IPv6 accepts garbage addresses" -- fix typo reported by chris-jerichio @ http://trac.transmissionbt.com/ticket/2778#comment:16
2010-01-31 17:15:05 +00:00
Charles Kerr
dcbb1ee872
#2778 (IPv6 PEX accepts garbage addresses) -- accept petch from jch to reject IPv6 addresses outside of 2000::/3 until the end of the 13th Baktun
2010-01-31 00:23:31 +00:00
Charles Kerr
ea36b9b888
(trunk libT) make "tr_globalAddress" a private function
2010-01-25 07:35:38 +00:00