Mike Gelfand [Mon, 5 Oct 2015 00:25:13 +0000 (00:25 +0000)]
Support compiling Mac client with Xcode 7
Latest Mac OS X SDK (10.11) doesn't include OpenSSL headers, but still
provides the libraries. Bundle our own copy of OpenSSL headers for now
(taken from running 10.10 system).
Mike Gelfand [Sun, 4 Oct 2015 06:16:59 +0000 (06:16 +0000)]
#5993: Improve magnets handling in main window
Disable "Open Folder" and "Verify Local Data" actions for magnets in
Torrent menu. If more than one torrent is selected, "Verify Local Data"
is enabled but only non-magnets are verified if activated.
Add a few sanity checks when opening folder, just in case.
Mike Gelfand [Tue, 1 Sep 2015 20:19:26 +0000 (20:19 +0000)]
Remove context help button from dialogs on Windows
We don't currently (if ever) provide context help, so the button is
useless. Moreover, on Windows 10 it's even larger than before and
sometimes title text doesn't fit because of it.
Mike Gelfand [Mon, 10 Aug 2015 19:40:58 +0000 (19:40 +0000)]
#5608: Enter file renaming mode with keyboard only, not on mouse double-click (Qt client)
Since double-click is usually used to open things, don't use it to enter
edit mode, use platform-specific keyboard shortcut instead (Return, F2,
etc).
Add context menu duplicating available actions, resembling that of Mac
client. This includes new "only check selected" action.
Speed up DND/priority change for large numbers of files at once. Make
DND/priority toggling more natural: if both parent and its child are
selected, only act on parent (with all its children following).
Mike Gelfand [Sun, 12 Jul 2015 20:48:54 +0000 (20:48 +0000)]
Improve file tree population/update performance
Use simple tokenization instead of splitting the file path into
QStringList for each item. Don't expand each added item separetely
during population/update. Don't expand all the items but just up to the
point where parent has more than one expandable child.
Also, fix items order by sorting items after population/update. Fix
sorting by size on systems where uint64_t != quint64.
Mike Gelfand [Sun, 5 Jul 2015 07:54:46 +0000 (07:54 +0000)]
#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."
Mike Gelfand [Wed, 1 Jul 2015 00:54:41 +0000 (00:54 +0000)]
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).
Mike Gelfand [Wed, 24 Jun 2015 21:24:41 +0000 (21:24 +0000)]
#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.
Mike Gelfand [Wed, 24 Jun 2015 20:38:41 +0000 (20:38 +0000)]
#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.
Mike Gelfand [Wed, 17 Jun 2015 20:32:33 +0000 (20:32 +0000)]
#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.
Mike Gelfand [Mon, 15 Jun 2015 21:07:46 +0000 (21:07 +0000)]
Torrent properties dialog improvements
Simplify DND checkboxes drawing, this also fixes incorrect drawing on
Mac when file tree widget is inactive.
Do better job calculating column widths for file tree to avoid ellipsis.
Fix file tree sorting order for size and priority columns.
Change key to toggle priorities to Shift+Space instead of Enter/Return
to avoid conflicts with name editing and default button handling.
Fix selected tracker item background drawing in certain cases.
Mike Gelfand [Sat, 18 Apr 2015 21:45:37 +0000 (21:45 +0000)]
Send dummy events each second to prevent excessive memory use (inspired by xnyhps)
I'm not that good in Mac programming it seems as I can't figure out why
doesn't the memory being allocated by frequent NSNewBitmapBackingStore
(system internal) calls being freed even if I wrap the code into
@autoreleasepool explicitly. Disabling animations does slow it down but
not stop. This commit is certainly a dirty fix but it seems to work in
my case and I hope it helps a few other people while we wait for a
proper solution.
Mike Gelfand [Sat, 11 Apr 2015 10:51:59 +0000 (10:51 +0000)]
#5908: Check for `tr_loadFile` return value instead of `errno` in `tr_variantFromFile`
Seems like there could be a defect in uClibc making errno not
thread-local. Don't rely on errno value but check function return value
instead which is a better failure indicator.
Return errors from `tr_loadFile` and `tr_variantFromFile` via tr_error.
Fix `tr_sessionLoadSettings` to not fail on Windows if settings.json
does not exist.
Mike Gelfand [Fri, 10 Apr 2015 22:15:41 +0000 (22:15 +0000)]
Tune directory paths on Windows
Use %USERPROFILE% instead of %USERPROFILE%\Documents as home directory.
Don't roam configuration directory (I don't think we want that).
Use known Downloads folder (instead of %HOME%\Downloads) if set.
When searching for web interface files, let local user application data
directory override roaming one, and roaming one override common one.
Use Vista+ API (SHGetKnownFolderPath) to get known folder paths.
Mike Gelfand [Sat, 4 Apr 2015 17:43:56 +0000 (17:43 +0000)]
#5910: Run daemon as a service on Windows
Factor out demonization implementation to platform-specific files.
Implement daemonization on Windows using service API. Improve *NIX
implementation by handling signals asynchronously to prevent potential
issues of running complex code inside the handler.