Commit graph

102 commits

Author SHA1 Message Date
Volkan Gezer
dd5296f03c Typo fix
Suggested by [mnestis](https://www.transifex.com/accounts/profile/mnestis/)
2014-06-29 14:06:45 +02:00
Olivier Goffart
2f284209d8 Permissions: When moving is not allowed, fallback to delete and upload
We decided that we never want to rename a directory behind the
back of the user as the user may be using files in the directory
during the sync.
If moving is not allowed, we just erase the inode form the database so
the next sync will try to do an upload and delete and recover from there
using normal resolution.

This also add some code to update the inode back to the db when it is detected
as changed.
2014-06-27 15:30:08 +02:00
Olivier Goffart
09881040a3 Permissions: fix restoring subdirectories
The sync item vector must be sorted before we call checkForPermission
2014-06-27 13:34:15 +02:00
Olivier Goffart
94ddf7e5d8 Merge remote-tracking branch 'origin/il' 2014-06-24 08:40:27 +02:00
Olivier Goffart
b735dc07d6 Permissions: Consider and empty remotePerms from csync as NULL
Since remotePerm from csync is never NULL (as it is a buffer),
we consider that if it is empty, there was no permission set
(and therefore everything is allowed)

csync will put a space in the permission if any permission was set
2014-06-23 15:05:48 +02:00
Olivier Goffart
e19214c3c4 permissions: record them even if the instruction is NONE
when the instruction is NONE, we may return from this function
before having registered the permission in the SyncEngine::_remotePerms
hash.
Move the code a bit up.
2014-06-23 13:35:34 +02:00
Olivier Goffart
b626589c07 Merge branch 'il'
Conflicts:
	src/mirall/folderstatusmodel.h
2014-06-23 12:52:03 +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
Daniel Molkentin
bbf8b9f8dd syncengine: properly initialize all members in ctor
This fixes Coverity CID 12922
2014-06-20 13:28:52 +02:00
Olivier Goffart
f80816d88f SyncEngine: silence coverity issue 12885
It was complaining that we use the context later in the function
but the csync context should never be null anyway
2014-06-20 11:53:22 +02:00
Olivier Goffart
02355696ff engine: When restoring the file, use the mtime and fileid from the server
Important to switch the things around as we are going to write them in the DB
2014-06-18 16:15:14 +02:00
Olivier Goffart
0880444e37 Syncengine: Wait for the neon thead to be finished before destroying the Propagator and calling csync_commit
The legacy job might still need the neon session and the propagator.
We need to make sure the thread exits before.

This fixes crash when pausing a sync made with the legacy jobs
(for example when there is network limitation)
This should fix https://github.com/owncloud/enterprise/issues/200
2014-06-18 15:08:23 +02:00
Klaas Freitag
b71881d300 SyncEngine: Use QSet for the seenFiles rather than QHash.
We can save some memory here as the seenFiles list can be long.
2014-06-17 16:30:11 +02:00
Olivier Goffart
c759e8bb8f permission: read them from the tree 2014-06-17 14:50:24 +02:00
Olivier Goffart
b83f6c0b3a sync engine: try to respect permission
This is still Work in progress
2014-06-17 14:44:58 +02:00
Olivier Goffart
2caa69e0cb blacklist: use the _ERROR instruction instead of _IGNORE
When something is in the blacklist, still use the _ERROR instruction
that way the applications can still report errors for blacklisted
items
2014-06-13 11:19:31 +02:00
Olivier Goffart
46b8260693 network limits: Do not read them from the config file in the engine
Do that from the folder, because the engine can be used in app where
the MirallConfigFile is not accessible
2014-06-07 12:09:22 +02:00
Markus Goetz
8dbfcd782b CSync: Fetch permissions from server for whole tree on server update 2014-06-06 17:10:07 +02:00
Markus Goetz
70ff928381 CSync & statedb: Parse 'perm' from server
ownCloud 6 sends this.
2014-06-06 15:24:17 +02:00
Markus Goetz
4d4eab8b1c CSync & Propagator: Support a direct download URL
This is for server file backends that support sending a
direct URL.
2014-06-03 14:55:34 +02:00
Markus Goetz
b8e20b412c CSync: We can access the context directly 2014-06-03 11:51:12 +02:00
Markus Goetz
5ee00a8df7 CSync: Simplify csync_owncloud stat/resource handling 2014-06-03 11:51:12 +02:00
Olivier Goffart
864f2cdc7d remove the _syncMutex and replace it by a simple bool 2014-05-29 11:35:13 +02:00
Olivier Goffart
99cead68f5 Fix crash when aborting
When aborting, the slotFinished will destroy all the Jobs, but they need
one more even loop to finish cleanups

Fixes #1793
2014-05-26 12:23:25 +02:00
Olivier Goffart
bdba56f60b Always wait on the thread before emiting finished
This ensure that there would be no way to have two thread running

Refactor all the location where finished is called in a single function
2014-05-20 12:32:06 +02:00
Olivier Goffart
90ee274744 We need to call csync_commit in every error cases
Else there will still be outdated tree in the memory and the further sync
will be confused

Relates to #1710
2014-05-15 11:18:06 +02:00
Klaas Freitag
a50c39cd0c Maintain the original inode value for renamed files.
In case two renames are done on the same file/folder very quickly we
lost the information that the second operation was also a rename. That
was because we tried to get the inode value from a stat on the file once
the first rename was finished. But at that point, the file was already
gone because of the second rename.

Now the original inode is kept and written to db in case the file can
not be stat'ed.

This fixes bug #1737
2014-05-06 12:55:54 +02:00
Olivier Goffart
988c162d2f Have only one place where we read the timeout 2014-05-02 13:04:53 +02:00
Olivier Goffart
9f0848ba15 Merge remote-tracking branch 'origin/libowncloudsync_noqtgui' 2014-04-29 12:23:15 +02:00
Markus Goetz
4489a56c65 Csync: Set error at correct place 2014-04-28 17:25:18 +02:00
Markus Goetz
7f752c7e93 Csync: Plug code for csync_file_locked_or_open 2014-04-28 16:57:56 +02:00
Olivier Goffart
9da261acd8 Do not read from the database when upgrading from 1.5
We need to make sure that the file id are updated (if the user
had upgraded from owncloud 5 to owncloud 6 while using owncloud 1.5)
2014-04-25 13:31:44 +02:00
Markus Goetz
77ac092975 WiP: Attempt to compile without UI 2014-04-21 19:57:15 +02:00
Olivier Goffart
fa38bf7029 Make sure the fileid are saved to the database when upgrading from owncloud5 to owncloud6
We fetch the id from the server, but don't save them in the database.

I Could have used INSTRUCTION_UPDATED for that, but then i would need to update the
reconcile algorithm to take in account the fact that UPDATED is possible there.

Instead, use should_update_etag  which means the db is going to be written again

Remove reference to old instruction _UPDATED and _DELETED which does not make sens with
the new propagator

Improve the test to test this case,  and that etags are properly writen to the DB
when there is a fake conflict
2014-04-18 18:27:27 +02:00
Klaas Freitag
82ab5fdcb9 Fix condition if network limit change is logged or not. 2014-04-15 16:28:18 +02:00
Volkan Gezer
8250fb81b3 Fix typo. 2014-04-11 15:10:47 +02:00
Daniel Molkentin
1d70426bb7 Build with BOTH Qt4 and 5 2014-04-07 17:25:25 +02:00
Daniel Molkentin
6a2fe6be67 Build fix: QAtomicInt has no implicit integer conversion in Qt5 2014-04-07 16:49:01 +02:00
Klaas Freitag
9cdcc925c1 Do not log useless stuff. 2014-04-07 15:10:55 +02:00
Klaas Freitag
cf87fdff7f Keep the updater data in the log struct for the synclog.
Also, shorten the timestamp and add the sync direction.
2014-04-03 16:56:50 +02:00
Olivier Goffart
bfe6a50b19 Fix some error cases in the SyncEngine
Always cleanup properly when we bail out.

Also fix thread safety of the SyncJournalDB
2014-04-01 13:41:47 +02:00
Markus Goetz
54313338cd SyncEngine: new aboutToPropagate signal 2014-03-27 17:04:31 +01:00
Markus Goetz
09e6207ce9 SyncEngine: Fix typo 2014-03-27 15:19:02 +01:00
Klaas Freitag
dd6b71bad6 Use a stopwatch to meassure the time consumed. 2014-03-26 18:16:27 +01:00
Klaas Freitag
9af2339596 Store the request duration and timestamp to final item 2014-03-26 18:16:27 +01:00
Klaas Freitag
6e6f647c63 Change data type for fileId to QByteArray. 2014-03-26 18:12:22 +01:00
Markus Goetz
d5659442b2 SyncEngine: Sanity bail out if DB does not exist suddenly
The update/reconcile worked for me, but the Propagate step had an invalid DB
path but still went on (and then messed things up)
2014-03-26 16:57:50 +01:00
Markus Goetz
cc5fabdab0 Engine: Introduce jobCompleted() signal 2014-03-21 17:13:02 +01:00
Olivier Goffart
c5f8a2555d Rename _dir to _direction
(to avoid confusion with directory)
2014-03-20 16:42:42 +01:00
Olivier Goffart
a1ab9c84c7 Remove FIXME in syncengine 2014-03-20 16:42:42 +01:00
Olivier Goffart
f05320c32c Clean the debug a bit 2014-03-17 12:15:16 +01:00
Olivier Goffart
7b482c0e96 Rename CSyncThread to SyncEngine
CSyncThread has not been a thread for a long time now
2014-03-17 11:34:51 +01:00
Renamed from src/mirall/csyncthread.cpp (Browse further)