Mike Gelfand
9853eb6715
Print log messages in one OutputDebugString()
call (Windows)
2015-12-13 10:34:53 +00:00
Mike Gelfand
ceb19b9711
Optionally return result length from evbuffer_free_to_str()
2015-12-13 10:23:22 +00:00
Mike Gelfand
073b05bb85
Reserve a few more bytes for base64 operations to prevent heap corruption
2015-12-13 01:29:39 +00:00
Jordan Lee
3ea43ba778
fix const warnings
...
In particular, in passing argv around as a "const char * const *"
instead of a "const char *".
2015-12-06 22:39:14 +00:00
Jordan Lee
3d76f23b2b
fix unused label warning
...
some #ifdef code had a goto label 'non_sparse_out', so that goto label was
unused on platforms where all those #ifdef blocks were disabled.
2015-12-06 22:24:35 +00:00
Jordan Lee
b559a20029
const correctness
...
silence some qual-cast warnings by sprinkling more consts throughout,
e.g. casting a const void* to a const struct foo * const *
2015-12-06 22:13:10 +00:00
Jordan Lee
39c48a162e
(trivial) remove trailing enum comma
2015-12-06 21:41:18 +00:00
Jordan Lee
562f56459f
remove unused macro
2015-12-06 16:39:38 +00:00
Mike Gelfand
505561c055
#5802 : Require absolute paths in "session-set" and "free-space" requests as well
2015-11-05 21:48:00 +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
88983c1ac1
Use tr_sys_path_remove instead of remove
2015-10-23 04:09:40 +00:00
Mike Gelfand
abb572fe26
Better support for UNC paths in tr_sys_path_is_relative
...
Accept \\ and // and valid UNC path prefixes, but not \/ or /\.
2015-10-23 03:55:04 +00:00
Mike Gelfand
5f420cafda
Rework Win32 basename and dirname implementation
...
Don't use _splitpath_s and _makepath_s as they don't support long paths
and UNC paths properly. Report error if path is not valid.
2015-10-23 03:42:11 +00:00
Mike Gelfand
650db1f46e
#5802 : Don't make assumptions of remote path validity in transmission-remote
...
Defer validity checks until path gets to the remote side, where they
actually make sense. Add simple checks for download directory path to
ensure it's not relative, since one cannot know what current working
directory of the remote process is.
2015-10-20 21:22:19 +00:00
Mike Gelfand
ca21c1f230
Always invoke async RPC callback, even if operation failed to start
2015-10-20 21:06:01 +00:00
Mike Gelfand
f89fab72f9
Remove unused session tag
2015-10-18 18:39:14 +00:00
Mike Gelfand
72f9dc6f92
#5992 : Remove now obsolete check for 13th Baktun (already happened)
2015-10-16 19:49:07 +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
c059eea6b4
#6005 : Style fix for previous commit (no functional changes)
2015-10-14 08:22:17 +00:00
Mike Gelfand
69687544d7
#6005 : Bump minimum OpenSSL version to 0.9.7, fix build for versions less than 0.9.8b
2015-10-13 21:24:31 +00:00
Mike Gelfand
0420699ad6
Initialise networking in daemon before making libevent calls
2015-10-11 16:35:51 +00:00
Mike Gelfand
8beea92859
Improve error handling when formatting error messages on Windows
2015-10-11 16:15:19 +00:00
Mike Gelfand
e745408f3b
Fix parameters order in tr_web_done_func
declaration
2015-10-08 19:47:59 +00:00
Mike Gelfand
1e6a3c2039
#5732 : Change length argument type to uint32_t for LTEP messages
2015-10-05 23:10:52 +00:00
Mike Gelfand
fcbc2915eb
#5732 : Fix possible overflow in messageLengthIsCorrect (partial patch by cfpp2p)
2015-10-05 01:21:47 +00:00
Mike Gelfand
a90a473d48
#6003 : Update to miniupnpc api 14 (slightly modified patch by infirit)
2015-10-04 04:53:18 +00:00
Mike Gelfand
18ea8c429a
Improve RPC performance for local sessions
...
Don't unnecessarily de-/serialize JSON data if local session is used.
2015-07-13 00:32:48 +00:00
Mike Gelfand
b9adf279ca
#5912 : Prevent completed pieces modification by webseeds (patch by cfpp2p)
...
This avoids blocks corruption in case webseed provides bad data.
As explained by cfpp2p, "The requirements to reproduce are at least one
webseed that sends corrupt block(s), and at least one other peer (webseed
or regular peer) that sends correct data for the same block. Then a peer
with correct block sends the block and transmission accepts and verifies
that block as good. But then the webseed thread comes around and the same
block is downloaded from the webseed that sends a bad block which is then
written even though the piece was previously deemed complete."
2015-07-05 07:54:46 +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
ba7ea94c7d
Avoid assert on passing negative values to isprint
(due to type promotion)
2015-06-26 21:22:27 +00:00
Mike Gelfand
2b5a03a88c
#5964 : Another follow-up commit for #5456 (encrypted communication with libevent 2.1.x)
...
Decrypt only what is asked for, not more. This fixes previous commit
which changed semantics by processing the buffer to the very end,
starting with correct offset though.
Refactor encryption/decryption to a single function which callback.
2015-06-24 21:24:41 +00:00
Mike Gelfand
cdcc9e249f
#5964 : Follow-up fix for #5456 (encrypted communication with libevent 2.1.x)
...
I've misread libevent documentation and the check introduced was not
entirely correct. Changed `evbuffer_peek` call now to only request the
data which would fit into provided iovec.
2015-06-24 20:38:41 +00:00
Mike Gelfand
6101a69957
Avoid possible _XOPEN_SOURCE
redefinition warning
2015-06-23 21:16:33 +00:00
Mike Gelfand
45b73a7866
#5456 : Fix encrypted communication with libevent 2.1.x
...
Recent versions of libevent changed the semantics of `evbuffer_ptr_set`
function in a way that it succeeds if pointer is set right after the end
of the buffer. This caused `tr_cryptoEncrypt` and `tr_cryptoDecrypt` to
be called twice for last buffer chunk since no checks for `evbuffer_peek`
return value were made while it was returning 0 on last loop cycle,
leaving iovec unchanged.
2015-06-17 20:32:33 +00:00
Mike Gelfand
088c5c6ab9
Bump DHT version used in CMake scripts (includes latest Win32 fixes)
2015-06-08 19:54:51 +00:00
Mike Gelfand
2804335d05
Don't print trailing space char on each line when saving JSON
2015-06-01 20:50:25 +00:00
Mike Gelfand
5d48c2d3e9
#5851 : Don't use _configthreadlocale if not provided by CRT (even if declaration is present)
2015-06-01 18:52:14 +00:00
Mike Gelfand
ae5755dc1e
#5851 : Use per-thread locale setup if possible
...
This prevents crashes on concurrent tr_variantFromBuf, tr_variantToBuf
and tr_variantGetReal use.
2015-06-01 05:25:14 +00:00
Mike Gelfand
2e6d5c8bc9
Add more booleans to the picture
2015-05-31 22:13:31 +00:00
Mike Gelfand
6c04259c39
Remove useless ws2tcpip.h include in net.h
...
It's already included above, and QT_DLL condition is meaningless
since net.h is only being used inside libtransmission which doesn't
use Qt.
2015-05-30 15:44:17 +00:00
Mike Gelfand
8dd65cdfba
Use CreateProcess instead of _spawnvpe to execute scripts on Windows
2015-05-30 11:15:57 +00:00
Mike Gelfand
7abe7c28a3
#4882 : \u-encode all non-printable (as opposed to non-ascii) characters
2015-05-16 17:33:01 +00:00
Mike Gelfand
e0dc1d6735
Fix some issues revealed by coverity
2015-05-09 14:10:55 +00:00
Mike Gelfand
4a23c94252
Fix some issues revealed by coverity
2015-05-09 14:09:05 +00:00
Mike Gelfand
cdf3cf62f9
Fix some issues revealed by coverity
2015-05-09 11:56:35 +00:00
Mike Gelfand
2321bc3fad
Fix some issues revealed by coverity
2015-05-09 08:37:55 +00:00
Mike Gelfand
df98031294
#5946 : Save "prefetch-enabled" setting as boolean (spotted by cfpp2p)
2015-05-07 06:45:35 +00:00
Mike Gelfand
5de8bbe6d8
Cut internal macro names to have equal number of underscores on each side (take two)
2015-05-04 20:06:05 +00:00