Olivier Goffart [Sun, 24 Sep 2017 19:58:41 +0000 (21:58 +0200)]
csync_reconcile: Optimize reconcile by avoiding alocations
Fix performence regression from commit
d66c2b5faecc689c52df23d7dbc44c894b92febc
For every new file we would look up every parent directories. Allocating
a new QByteArreay for every parent riectory just to know if it is in the other
tree is wasting lots of CPU.
Use a ByteArrayRef trick, similar to QStringRef
Dominik Schmidt [Fri, 22 Sep 2017 08:45:40 +0000 (10:45 +0200)]
Set CMAKE_INSTALL_RPATH as RPATH for installed executables
Christian Kamm [Fri, 22 Sep 2017 08:32:38 +0000 (10:32 +0200)]
Packaging: Add options for fine-grained builds #5957
Extracted and adjusted from packaging.diff by @jnweiger and @dschmidt
Christian Kamm [Fri, 22 Sep 2017 08:29:17 +0000 (10:29 +0200)]
Packaging: Adjust APPNAME handling #5957
Extracted and adjusted from packaging.diff by @jnweiger and @dschmidt
Christian Kamm [Fri, 22 Sep 2017 08:28:08 +0000 (10:28 +0200)]
Packaging: Make check for theme.qrc more specific #5957
Extracted and adjusted from packaging.diff by @jnweiger and @dschmidt
Christian Kamm [Fri, 22 Sep 2017 08:25:51 +0000 (10:25 +0200)]
Packaging: Change directory for docs #5957
Extracted and adjusted from packaging.diff by @jnweiger and @dschmidt
Christian Kamm [Fri, 22 Sep 2017 08:16:26 +0000 (10:16 +0200)]
Move the --version output text to Theme #5957
Extracted and adjusted from packaging.diff by @jnweiger and @dschmidt
Jenkins for ownCloud [Wed, 27 Sep 2017 00:18:33 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Olivier Goffart [Mon, 25 Sep 2017 09:49:11 +0000 (11:49 +0200)]
Use QDateTime::currentDateTimeUtc instead of the non utc version
QDateTime::currentDateTime is terribly slow.
Olivier Goffart [Mon, 25 Sep 2017 14:44:33 +0000 (16:44 +0200)]
OAuth: Fix crash when closing the browser while identifying
To reproduce, log in and click "authorize" on the browser, then close
the browser before the client has replied, (but after redirected to localhost,
i.e. when the client is asking the server for the token)
The problem is that socket can be destroyed so we don't need to answer on a
destroyed socket.
Olivier Goffart [Mon, 25 Sep 2017 12:19:48 +0000 (14:19 +0200)]
OwnSQL: don't parse the error message when we are done
Jocelyn Turcotte [Thu, 14 Sep 2017 14:34:14 +0000 (16:34 +0200)]
SyncJournalDb: Reimplement the db_is_empty logic from csync
This reduces the initial sync local discovery time from
2.0 to 0.6 seconds in LargeSyncBench on my machine.
Jocelyn Turcotte [Thu, 14 Sep 2017 13:50:13 +0000 (15:50 +0200)]
Use SyncJournalDb in csync
This gets rid of the csync_statedb sqlite layer and use
the same code and same connection as the rest of the SyncEngine.
Missing functions are added to SyncJournalDb and change a few minor
things (like changing SyncJournalFileRecord::_modtime to be an int64
instead of a QDateTime, like it was in csync).
Jocelyn Turcotte [Wed, 13 Sep 2017 17:02:38 +0000 (19:02 +0200)]
SyncJournalDB: Allow callers of getFileRecord if the query failed
The current implementation would return the same value whether the query failed
or if no row would be found. This is something that is currently checked by csync
and needs to be provided if we want to use SyncJournalDB there.
Adjusted all call sites to also check the return value even though they
could still just rely on rec.isValid(), but makes it more explicit as to what
happens for database errors in those cases, if we ever want to gracefully handle
them.
Jocelyn Turcotte [Wed, 6 Sep 2017 09:55:37 +0000 (11:55 +0200)]
SyncJournalDB: Bind phash as a qlonglong instead of a QString
This is what csync does and we don't need to pass it as a string
to let sqlite convert it back to a uint64 later.
Jenkins for ownCloud [Tue, 26 Sep 2017 00:18:33 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Olivier Goffart [Mon, 25 Sep 2017 09:55:18 +0000 (11:55 +0200)]
bandwidthmanager: Fix unregistering devices on delete
from the destroyed signal, qobject_cast won't work because the object
is already destroyed. One must use reinterpret_cast then
Olivier Goffart [Mon, 25 Sep 2017 09:58:30 +0000 (11:58 +0200)]
PropagateUpload: Fix another non-normalized connect that appears while profiling
Olivier Goffart [Mon, 25 Sep 2017 10:48:33 +0000 (12:48 +0200)]
benchlargesync: Do several syncs
Make sure there is already a small sync before so the database is queried.
Make also a sync after to run an update with many files in the database.
Olivier Goffart [Sat, 23 Sep 2017 12:09:19 +0000 (14:09 +0200)]
c_utf8_from_locale: optimize the UTF8 case on Linux
Avoid converting to a QString as an intermediate step
Olivier Goffart [Sat, 23 Sep 2017 11:49:30 +0000 (13:49 +0200)]
csync: use a unordered_map for the FileMap
Saves more than 10% of csync_update on LargeSyncBench
Jenkins for ownCloud [Mon, 25 Sep 2017 00:18:29 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Olivier Goffart [Sun, 24 Sep 2017 18:06:08 +0000 (20:06 +0200)]
chsck_vio: fix readdir test by removing it.
The code that was creating the files in the directory was removed in
commit
6906b8d30c846bf0e03f1252b71e169e50786efa. The directory is empty
so the result is expected to be null. It was passing before because the
code was returning an entry for . and .., but since commit
35f80bd4390bb3ab92ccd8fa740d96c18ce16e93 this is no longer the case
Olivier Goffart [Sat, 23 Sep 2017 12:01:07 +0000 (14:01 +0200)]
Jenkins for ownCloud [Sun, 24 Sep 2017 00:18:33 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Markus Goetz [Sat, 23 Sep 2017 11:42:39 +0000 (13:42 +0200)]
macOS: Fix compile
Olivier Goffart [Fri, 22 Sep 2017 16:59:48 +0000 (18:59 +0200)]
Httpcreds: Fix double slash in the Request App Password url
Issue #6044
Olivier Goffart [Fri, 22 Sep 2017 16:05:47 +0000 (18:05 +0200)]
OAuth2: Fix double slash in URL
We need to use concatPath to avoid possible double '/' in the URLs if the
account url() ends with '/'.
This has become even more of a problem since commit
d1b8370a4ad21c741da507f64a5dbfe82a3fad05 which was resolving the url after
a redirect where most server actually add a '/' if the url is a folder
Jenkins for ownCloud [Sat, 23 Sep 2017 00:18:30 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Olivier Goffart [Fri, 22 Sep 2017 07:51:22 +0000 (09:51 +0200)]
csync_vio_local: merge readdir and stat in the same call
For the remote this was already done long time ago
For windows, this was already partially done
The goal is to avoid needless conversion of the path to local encoding.
Olivier Goffart [Thu, 21 Sep 2017 13:45:56 +0000 (15:45 +0200)]
csync_update/reconcile: replace CSYNC_LOG with qDebug/qInfo
CSYNC_LOG has quite an overhead as it uses vsprintf and it might
be run even if the category is disabled
Christian Kamm [Fri, 22 Sep 2017 09:06:29 +0000 (11:06 +0200)]
SyncEngine: Adjust free space messaging
Before, the way the info message was phrased implied a failure. And
since the large numbers can be hard to compare that can be confusing.
Olivier Goffart [Fri, 22 Sep 2017 07:32:29 +0000 (09:32 +0200)]
csync: remove unused type
Olivier Goffart [Tue, 19 Sep 2017 08:53:51 +0000 (10:53 +0200)]
RemotePermissions: Store in a class rather than in a QByteArray to save memory
Create a specific type that parses the permissions so we can store
it in a short rather than in a QByteArray
Note: in RemotePermissions::toString, we make sure the string is not
empty by adding a space, this was already existing before commit
e8f7adc7cacd4f55e26b2dd14464654e82204307 where it was removed by mistake.
Jenkins for ownCloud [Fri, 22 Sep 2017 00:18:30 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Olivier Goffart [Wed, 20 Sep 2017 09:48:13 +0000 (11:48 +0200)]
Port to new signal-slot syntax what cannot be done automatically
Some slot were protected or private but needed to be public.
Some needed a static_cast (can't use qOverload because it is in Qt 5.7)
This is not only a partial change.
Olivier Goffart [Wed, 20 Sep 2017 16:45:00 +0000 (18:45 +0200)]
DiscoveryPhase: use the new syntax in disconnect
Since we used the new syntax in connect, we need to use it in disconnect
Olivier Goffart [Wed, 20 Sep 2017 08:14:48 +0000 (10:14 +0200)]
Use the Qt5 connection syntax (automated with clazy)
This is motivated by the fact that QMetaObject::noralizeSignature takes 7.35%
CPU of the LargeSyncBench. (Mostly from ABstractNetworkJob::setupConnections and
PropagateUploadFileV1::startNextChunk). It could be fixed by using normalized
signature in the connection statement, but i tought it was a good oportunity
to modernize the code.
This commit only contains calls that were automatically converted with clazy.
Olivier Goffart [Wed, 20 Sep 2017 14:50:34 +0000 (16:50 +0200)]
test/stub: add some call required by the next patches
As we use the new connection syntax in folderman.cpp, some more symbol
need to be mocked
Olivier Goffart [Wed, 20 Sep 2017 15:14:33 +0000 (17:14 +0200)]
Include <QAuthenticator> from code that connect to signal that uses it
The new connection syntax will need that
Olivier Goffart [Wed, 20 Sep 2017 14:49:41 +0000 (16:49 +0200)]
Gui: Use lambda instead of QSignalMapper
It's simpler, and QSignalMapper is deprecated in Qt 5.10
Olivier Goffart [Wed, 20 Sep 2017 15:18:37 +0000 (17:18 +0200)]
Remove settingsdialog.cpp.Rbt431
Jenkins for ownCloud [Thu, 21 Sep 2017 00:18:30 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Markus Goetz [Wed, 20 Sep 2017 12:44:33 +0000 (14:44 +0200)]
ChangeLog: More 2.4.0 changes
Jenkins for ownCloud [Wed, 20 Sep 2017 00:18:35 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Christian Kamm [Tue, 19 Sep 2017 10:44:59 +0000 (12:44 +0200)]
Fix compile with bad strrchr signature
Christian Kamm [Mon, 18 Sep 2017 08:23:20 +0000 (10:23 +0200)]
Conflicts: Upload them files if env variable says so
Set OWNCLOUD_UPLOAD_CONFLICT_FILES=1 to trigger this behavior.
Note that this is experimental and unsupported. The real feature is
likely to end up in 2.5.
Uploading conflict files is simply done by removing the pattern from
csync_exclude. The rest here deals with making the conflict notification
ui approximately work.
There are still some concerns about where an uploaded conflict file
appears in the sync protocol and issues list (it should be in both, but
is only in one of them currently!).
See #4557.
Christian Kamm [Fri, 15 Sep 2017 12:24:34 +0000 (14:24 +0200)]
Private links: Retrieve link through propfind property #6020
* The sharing ui does a propfind anyway: use that to query the new
property as well!
* For the socket api, asynchronously query the server for the right url
when an action that needs it is triggered.
The old, manually generated URL will be used as fallback in case the
server doesn't support the new property or the property can't be
retrieved for some reason.
Depends on owncloud/core#29021
Jenkins for ownCloud [Tue, 19 Sep 2017 00:18:38 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Jocelyn Turcotte [Mon, 18 Sep 2017 13:30:35 +0000 (15:30 +0200)]
Fix the build (make install)
Olivier Goffart [Thu, 14 Sep 2017 13:09:21 +0000 (15:09 +0200)]
Gui: Allow to add multiple sync folder connection of the same folder
... or child folders
There is also no real reason to forbid the user from syncing the same
folder to multiple location on its hardrive.
A real use case is when the user uncheck a big directory using "choose
what to sync", but would still like to sync a folder within this disabled
tree. The user can now do this with the "add folder" feature
Since 2.3, we even support syncing the same local folder to multiple
remote folder, so why not allow syncing the same remote folder several
times?
Relates to issue #3645
Jocelyn Turcotte [Wed, 6 Sep 2017 09:36:45 +0000 (11:36 +0200)]
SyncJournalDB: Only reset_and_clear_bindings once
We only need to do it once between each query execution and
that can be right before the first bind.
Jocelyn Turcotte [Thu, 14 Sep 2017 11:30:57 +0000 (13:30 +0200)]
csync_update: Remove the check for csync_get_statedb_exists
This always returns true since _csync_statedb_is_empty also always
returns true. This function was initially intended to be a shortcut
in case the database doesn't contain any row, but has been broken since
27fb5d9128c3d326191d5f9f01dac4f715000682 and now won't return false
unless the statement fails.
The _last_db_return_error in _csync_detect_update would take care
of that code path in a more direct and clearer way anyway.
Jocelyn Turcotte [Fri, 1 Sep 2017 16:11:43 +0000 (18:11 +0200)]
Move SyncJournalDB to src/common
Jocelyn Turcotte [Wed, 30 Aug 2017 09:17:23 +0000 (11:17 +0200)]
Reverse the dependency between SyncJournalFileRecord and SyncFileItem
This will allow us to also use the SyncJournalDB in csync.
Jocelyn Turcotte [Wed, 30 Aug 2017 17:34:41 +0000 (19:34 +0200)]
Move non-csync-dependent parts of FileSystem to src/common
This keep the csync-dependent parts in src/libsync, slitting the namespace
over two files.
This will allow moving SyncJournalDB to src/common as well.
Jocelyn Turcotte [Fri, 15 Sep 2017 10:35:40 +0000 (12:35 +0200)]
Update sync-algorithm.md
The rbtree was replaced by a std::map.
Christian Kamm [Fri, 15 Sep 2017 11:30:29 +0000 (13:30 +0200)]
Checksums: Clearer behavior and added testing
Jocelyn Turcotte [Thu, 24 Aug 2017 15:31:46 +0000 (17:31 +0200)]
Remove SyncFileItem::_isDirectory
It's always equivalent to _type == SyncFileItem::Directory.
Jocelyn Turcotte [Thu, 24 Aug 2017 15:07:22 +0000 (17:07 +0200)]
Remove SyncFileItem::log
This remove the remaining "other" fields of the sync log to save a
bit of memory.
other_etag and other_fileId don't give much information to the users
and other_instruction will always be INST_NONE anyway.
other_modtime and other_size are kept since they are sometimes used.
They were renamed to have a bit more meaningful name.
SyncEngine::checkPermissions will now fetch its information from the
csync trees since they are now preserved until right after this point.
Fixes #3213
Jocelyn Turcotte [Thu, 24 Aug 2017 14:48:40 +0000 (16:48 +0200)]
Remove SyncEngine::_remotePerms
Now that csync is using a more convenient data structure for
its file trees, wait a little bit longer before destroying them and
fetch the remote permissions from the remote tree there instead.
Jocelyn Turcotte [Wed, 23 Aug 2017 17:30:55 +0000 (19:30 +0200)]
Remove the usage of phash in csync
Only store the path since they represent the same thing, and do the
phash conversion during DB lookup like done in libsync.
We could get rid of everything since we also have an index on the path
column, but since it's the primary key this makes the migration non-trivial.
Jocelyn Turcotte [Wed, 23 Aug 2017 17:16:12 +0000 (19:16 +0200)]
Replace the custom rbtree by a std::map
Jocelyn Turcotte [Thu, 17 Aug 2017 17:06:58 +0000 (19:06 +0200)]
csync: Keep the csync_file_stat_t instances created during discovery
Now that they use the same structure, avoid _csync_detect_update
having to recreate another instance and transfer everything manually.
Any instance created during discovery should now be used all the way
up to SyncEngine::treewalkFile.
This also makes sure that the path and types are properly set in that
object instead of having to pass everything as separate parameters.
This gets rid of csync_ftw_flags_e which was now converted from,
and to csync_ftw_type_e, already in the csync_file_stat_t.
Issue #1817
Jenkins for ownCloud [Mon, 18 Sep 2017 00:18:30 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Jenkins for ownCloud [Sun, 17 Sep 2017 00:18:29 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Jenkins for ownCloud [Sat, 16 Sep 2017 00:18:35 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Christian Kamm [Fri, 15 Sep 2017 07:24:56 +0000 (09:24 +0200)]
AbstractNetworkJob: Allow relative redirect
Previously all redirects were considered absolute.
Christian Kamm [Fri, 15 Sep 2017 07:11:52 +0000 (09:11 +0200)]
Reduce timeout for some admin jobs
The oauth token jobs and the wizard redirect check job shouldn't have
5min timeouts.
Christian Kamm [Mon, 11 Sep 2017 11:45:01 +0000 (13:45 +0200)]
Wizard: Handle url-shortener redirects #5954
Grab any permanent redirects from the base url the user entered
before attempting to connect to a modified url (with status.php
added).
Christian Kamm [Thu, 14 Sep 2017 12:45:46 +0000 (14:45 +0200)]
HttpCreds: Remove migration code from 1.7
Christian Kamm [Tue, 12 Sep 2017 15:15:22 +0000 (17:15 +0200)]
Credentials: Use per-account keychain entries #5830
This requires a lot of migration code: the old entries need to be read,
saved to the new locations and then deleted.
Christian Kamm [Wed, 13 Sep 2017 07:27:07 +0000 (09:27 +0200)]
Journal: Second attempt at journal mode fallback #5723
Some filesystems, vms or other limitations make using the WAL journal
mode impossible. We are notified of this problem through an sqlite
IOERR for SHMMAP. In that case We want to attempt to fall back to the
DELETE journal mode.
Christian Kamm [Mon, 11 Sep 2017 10:24:29 +0000 (12:24 +0200)]
OAuth: Don't use implicit POST bodies
The query args of POST requests become the request body. If there's a
redirect, the redirected url will therefore not contain the query
arguments. Use an explicit request body to make the redirection work.
Christian Kamm [Mon, 11 Sep 2017 10:23:52 +0000 (12:23 +0200)]
OAuth: Pass client auth in header instead of url
To play more nicely with redirects.
Christian Kamm [Fri, 8 Sep 2017 14:43:59 +0000 (16:43 +0200)]
OAuth: Use redirectable jobs for oauth token management
Christian Kamm [Wed, 12 Jul 2017 07:58:15 +0000 (09:58 +0200)]
PropagateUpload: Model of remote quota, avoid some uploads #5537
When we see a 507 error, assume that quota is < uploaded size.
Christian Kamm [Wed, 12 Jul 2017 11:19:58 +0000 (13:19 +0200)]
SyncOptions/Propagator: Parallelism as an option
Very useful for changing it on a per-test basis.
Christian Kamm [Wed, 12 Jul 2017 10:38:53 +0000 (12:38 +0200)]
Make DetailError different from BlacklistedError
It's quite different in regard to blacklist handling and overall
sync failure changes.
Helmut K. C. Tessarek [Wed, 13 Sep 2017 04:26:56 +0000 (00:26 -0400)]
remove qt4 code
Jenkins for ownCloud [Fri, 15 Sep 2017 00:18:32 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Christian Kamm [Wed, 13 Sep 2017 11:03:40 +0000 (13:03 +0200)]
Excludes: Allow escaping # #6012
Otherwise adding patterns that start with # are impossible to add, since
they get treated as comments. Also add this escaping for patterns added
in the ui.
Jenkins for ownCloud [Thu, 14 Sep 2017 00:18:30 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Jenkins for ownCloud [Wed, 13 Sep 2017 00:18:31 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Markus Goetz [Tue, 12 Sep 2017 15:07:19 +0000 (17:07 +0200)]
ChunkingNgTest: CI debuggability #6015
Christian Kamm [Tue, 12 Sep 2017 11:39:45 +0000 (13:39 +0200)]
Journal: Fall back to DELETE on IO error #5723
Also add logging of extended error codes for this IO error, maybe we can
become more specific about which situations should trigger a journal
mode switch.
Christian Kamm [Tue, 12 Sep 2017 11:02:00 +0000 (13:02 +0200)]
Folder: Check etag again after active sync #4116
Maybe more things were happening on the server?
Jenkins for ownCloud [Tue, 12 Sep 2017 00:18:30 +0000 (02:18 +0200)]
[tx-robot] updated from transifex
Christian Kamm [Fri, 8 Sep 2017 09:59:45 +0000 (11:59 +0200)]
Update server url in case of permanent redirection #5972
This is the first time the account url may update outside of
account setup.
Summary of redirection handling:
1. During account setup (wizard)
- status.php gets permanently redirected -> adjust url
- authed PROPFIND gets *any* redirection -> adjust url
2. During connectivity ping (ConnectionValidator)
- status.php gets permanently redirected -> adjust url (new!)
All other redirections should be followed transparently and
don't update the account url in the settings.
Christian Kamm [Thu, 7 Sep 2017 12:58:45 +0000 (14:58 +0200)]
Use DetermineAuthTypeJob in HttpCredentials
* Move it to networkjobs
* Minor adjustments to its logic
* Fixes redirect handling for oauth/basic http auth check #6003
Markus Goetz [Mon, 11 Sep 2017 16:53:51 +0000 (18:53 +0200)]
Add clean_tarball.sh #6005
Jenkins for ownCloud [Mon, 11 Sep 2017 14:03:15 +0000 (16:03 +0200)]
[tx-robot] updated from transifex
Jocelyn Turcotte [Mon, 11 Sep 2017 13:32:42 +0000 (15:32 +0200)]
Windows: Make sure that the folder and Desktop.ini have the right attributes (#6018)
When created from scratch, the owncloud icon won't be picked-up by
explorer unless the right attributes are set on both the sync root and the
Desktop.ini file.
Issue #2446
rockihack [Mon, 4 Sep 2017 11:42:20 +0000 (13:42 +0200)]
Enable DEP & ASLR on Windows
Markus Goetz [Fri, 8 Sep 2017 13:23:01 +0000 (15:23 +0200)]
Remove qtkeychain submodule #6004
Jocelyn Turcotte [Fri, 8 Sep 2017 11:54:04 +0000 (13:54 +0200)]
Fix the macOS Sparkle build
Christian Kamm [Thu, 7 Sep 2017 09:10:23 +0000 (11:10 +0200)]
Http credentials: Fix behavior for bad password #5989
When the GET request from askFromUser is scheduled on the QNAM inside
the slot that handles the QNetworkReply::finished signal, it seems to
not get processed at all.
This workaround moves the sending of the new GET to the event loop,
sidestepping the problem.
Christian Kamm [Thu, 7 Sep 2017 09:02:05 +0000 (11:02 +0200)]
Fix compile errors
cmocka seems to #define fail to something inappropriate.
Jocelyn Turcotte [Thu, 7 Sep 2017 08:26:19 +0000 (10:26 +0200)]
csync_statedb: (really) Make sure children of non-synced items aren't read from the DB
No tests are covering this and I reversed the original logic.
Jocelyn Turcotte [Thu, 7 Sep 2017 08:16:16 +0000 (10:16 +0200)]
csync_statedb: Make sure children of non-synced items aren't read from the DB
Fix a regression during C++ conversion from
704ca366b38391c0ef56e090561b4a3a158307fb