Commit Graph

55 Commits

Author SHA1 Message Date
Jocelyn Turcotte a480a318fd Hardcode Desktop.ini in the exclude list
This prevents it from being removed from the exclude list, which
would be an issue since the client itself creates this file in a way
that wouldn't match on machines with different installation paths.
2017-08-15 13:37:33 +02:00
Christian Kamm 2cdf5517cb Conflicts: Detect and show in issues tab
Incidentally fixes a potential issue where conflicts were silently-
ignored and thus deleted if the parent folder was deleted.
2017-07-13 11:48:10 +02:00
Christian Kamm 4291ea47f7 Journal: Don't use a ._ path if it won't work #5633
When synchronizing a folder on a samba share, creating files that begin
with ._ is often forbidden. This prevented the client from creating
its ._sync_abcdef.db file.

Now, it'll check whether the preferred filename is creatable, and if
it isn't it'll use .sync_abcdef.db instead.

The disadvantage is that this alternative path won't be ignored by
older clients - that was the reason for the ._ prefix.
2017-06-20 13:35:34 +02:00
Jocelyn Turcotte f1e9be4fa8 Don't use the StopWatch for each job in production builds #5456
This accounted for more than 10% of the peak memory usage while only
providing value through the debugging log.
2017-01-26 17:13:54 +01:00
Christian Kamm 9641c7a1e7 Rename sync journal to ._sync_xxx.db.
The added underscore means that older clients will also ignore the
file.
2016-11-23 16:48:15 +01:00
Christian Kamm 3e59a9b316 Merge branch 'master' into dbjournal_per_account 2016-11-23 16:47:56 +01:00
Jocelyn Turcotte 2b274e9460 Fix the MSVC build
- Replace functions that are provided by MinGW with a Win32-based
  implementation
- Explicitly export needed symbols from ocsync.dll
- Rename share.h to sharemanager.h since the name clashes with one
  of the Windows headers and get included from there
- Remove the timestamp from the fallback csync stderr logging, it's
  not used since we always provide a log callback
2016-09-16 17:43:39 +02:00
Klaas Freitag 62125a442d csync_exclude: Also exclude the new syncjournal filename. 2016-09-02 15:49:21 +02:00
Jocelyn Turcotte b7ff4a76e8 Add TestSyncEngine and TestSyncFileStatusTracker auto tests
To be able to test the SyncEngine efficiently, a set of server
mocking classes have been implemented on top of QNetworkAccessManager.

The local disk side hasn't been mocked since this would require adding
a large abstraction layer in csync. The SyncEngine is instead pointed
to a different temporary dir in each test and we test by interacting
with files in this directory instead.

The FakeFolder object wraps the SyncEngine with those abstractions
and allow controlling the local files, and the fake remote state
through the FileModifier interface, using a FileInfo tree structure
for the remote-side implementation as well as feeding and comparing
the states on both side in tests.

Tests run fast and require no setup to be run, but each server feature
that we want to test on the client side needs to be implemented in
this fake objects library. For example, the OC-FileId header isn't
set as of this commit, and we can't test the file move logic properly
without implementing it first.

The TestSyncFileStatusTracker tests already contain a few QEXPECT_FAIL
for what I esteem being issues that need to be fixed in order to catch
up on our test coverage without making this patch too huge.
2016-08-17 15:39:30 +02:00
Christian Kamm eadecc5802 Excludes: Fix a Windows specific bug #5039
It meant that almost nothing was being excluded.

Broken since 87b4693a9d
2016-07-19 15:38:57 +02:00
Christian Kamm 6e9df8673f Merge remote-tracking branch 'origin/2.2' 2016-06-22 15:41:37 +02:00
Klaas Freitag 191177ff22 excludes: Only log if the pattern was really logged. (#4989) 2016-06-20 15:50:20 +02:00
ckamm 43a2aec92b Performance: Don't redundantly add the same exclude files #4967 (#4988)
Excludes: Don't redundantly add the same exclude files #4967, Never accept duplicate exclude patterns #4967
2016-06-20 15:14:13 +02:00
Christian Kamm 87b4693a9d Add error message for trailing spaces on Windows #4878 2016-06-09 12:41:02 +02:00
Christian Kamm ceb4a23dab Fix compile with strict C flags 2016-03-18 12:41:57 +01:00
Christian Kamm d7bd1300a8 Ignores: expand escapes #4568 2016-03-17 14:31:53 +01:00
Jocelyn Turcotte b8227afcaa Move the csync_context creation in SyncEngine
The creation doesn't need to be separated from the SyncEngine anymore.
This allows the SyncEngine to be created in fewer steps if we want to
use it in tests.

This moves most of the direct csync code from Folder into the SyncEngine.
The exclude file logic for the context has been wrapped using the
existing ExcludedFiles class as well.
2016-02-25 20:53:13 +01:00
Olivier Goffart 91525a7d33 csync_exclude: Don't ignore invalid char client side (#3736)
If the server does not support it, then the server will reply with an error
2015-10-22 12:32:53 +02:00
Olivier Goffart de5de7acc5 csync_exclude: Optimize
Avoid alocations as much as possible
2015-10-20 18:38:47 +02:00
Jocelyn Turcotte 35318ea9b5 Fix the Windows build
Use an iterator variable declared outside of the loop condition
expression.

MinGW doesn't support C99 very easily and it's easier to keep
our C code C89 compliant.
2015-08-31 17:23:25 +02:00
Christian Kamm 07ca0be3c5 csync_excluded: Another speedup #3638
Build a list of path components outside of the exclude pattern loop.
2015-08-24 15:08:06 +02:00
Christian Kamm fe49255bff csync_excluded: Add fast _traversal() function #3638
This function only checks the full path and the basename and is thus
around 7x faster. It is very useful in a csync_update context where
we know that the leading dirs have already been checked for exclusion.
2015-08-24 15:08:06 +02:00
Christian Kamm 20f4ec6b67 csync_exclude: Speed up siginificantly #3638
The performance test indicates a speedup of around 3x for paths
with around 12 components.
2015-08-24 15:08:06 +02:00
Klaas Freitag d9b44b3a69 Created two functions c_utf8_string_to_locale and c_utf8_path_to_locale.
Before we only had c_utf8_to_locale, but now functionality is needed to
convert a path to UNC before converting it. That does c_utf8_path_to_locale
now, while c_utf8_string_to_locale only converts the plain string, ie.
to generate wide char strings for output.
2015-07-08 18:13:39 +02:00
Olivier Goffart 5dcb276376 csync: fix a few possible leak in error cases 2015-06-08 15:31:14 +02:00
Markus Goetz 625e61516f Propagator: Limit length of temporary file name #2789 (fixup)
Fix 22c35c4d15
2015-05-11 15:42:35 +02:00
Daniel Molkentin 14e0e4a072 Win32: More reserved file names to ignore, including Recycle Bin
Addresses #2955
2015-03-12 16:25:32 +01:00
Christian Kamm b03209ccef Inform user about ignored long files. #2882 2015-02-27 12:12:39 +01:00
Klaas Freitag 4f7c062f3f csync_exclude: Ignore files where the filename length is > 254 chars.
This is for example HFS+ and others. It fixes #2882
2015-02-26 17:09:49 +01:00
Markus Goetz af9daaeff7 CSync: Remove memory checks
We will get OOMed before this fails.
2015-01-23 16:59:51 +01:00
Daniel Molkentin d76192cce1 Ignore reserved words on Windows
Fixes #2385 and #2386
2014-10-24 13:18:57 -04:00
Klaas Freitag 0cc2bbf5d9 csync exclude: Export the csync_exclude_add function in debug mode 2014-09-18 15:34:24 +02:00
Daniel Molkentin 2dfbc2058f Win32: ignore files ending in '.' or at least one space
Fixes #416
Fixes #2176
2014-09-10 15:21:19 +02:00
Olivier Goffart 79d13d9242 Selective sync: deselecting a folder removes it from the local file system 2014-08-28 15:53:49 +02:00
Klaas Freitag dc8f437b31 Excludes: Add an context free implementation of exclude file loading.
So that we are more thread safe.
2014-08-21 12:43:04 +02:00
Olivier Goffart c1831f4946 Selective sync: use a black list instead of a white list 2014-08-15 12:29:10 +02:00
Olivier Goffart 4b2c1bacd1 Merge remote-tracking branch 'origin/master' into selective_sync 2014-08-15 10:28:50 +02:00
Olivier Goffart 4ff0e7e0a2 Silent some warnings 2014-08-12 14:03:04 +02:00
Olivier Goffart 12459bf07e selective sync: fix whitelist matching 2014-08-12 11:43:42 +02:00
Olivier Goffart 7e009667a2 Selective sync: ignore the files that are not in the selective sync white list 2014-08-11 18:42:24 +02:00
Olivier Goffart 02704cdf74 Merge remote-tracking branch 'origin/1.6' into il
Conflicts:
	VERSION.cmake
	csync/src/csync_statedb.c
	src/mirall/syncengine.cpp
	src/mirall/syncfileitem.h
2014-06-23 12:48:34 +02:00
Klaas Freitag 041066a252 Exclude: Add a missing free in case of empty lines.
This fixes Coverity CLT 12893
2014-06-20 15:15:35 +02:00
Klaas Freitag b144a5bbf9 csync_exclude: Add a missing free of path components.
This fixes Coverity CID 12895
2014-06-20 11:14:50 +02:00
Daniel Molkentin bec66c85d4 Fix potential memory leak
This fixes Coverity CID 12893
2014-06-20 10:58:03 +02:00
Markus Goetz 4e28ba73bb Windows: Fix build harder. 2014-06-05 10:13:20 +02:00
Markus Goetz d4d630b2e9 Windows: Fix build 2014-06-04 12:47:17 +02:00
Klaas Freitag 16d35c1489 Avoid crash on csync_ctx is NULL. 2014-06-03 09:50:09 +02:00
Markus Goetz 94f380c1f0 Updater: Ignore files matching with CSYNC_CONFLICT_FILE_USERNAME 2014-04-22 17:05:59 +02:00
Olivier Goffart eaf5681f61 Put the sync log in the actual folder 2014-04-02 16:36:32 +02:00
Markus Goetz a2e8bfd962 csync: Remove unix_extensions 2014-02-27 13:23:35 +01:00