Commit graph

125 commits

Author SHA1 Message Date
Klaas Freitag
20b9ae757d Add a http status code varialbe to the sync item object. 2013-11-20 14:27:44 +01:00
Markus Goetz
e551e92e13 Downloads: Ignore file if no ETag was sent
Fixes part of #970
2013-11-19 12:44:25 +01:00
Klaas Freitag
69269f8f75 Use transactions to speed up database access. 2013-11-18 10:02:32 +01:00
Klaas Freitag
b0f6628584 Moved implementation of start() to cpp file. 2013-11-18 10:02:32 +01:00
Klaas Freitag
42f6867329 Add some useful logging. 2013-11-18 10:02:32 +01:00
Olivier Goffart
c15a1eedd1 Only update the db for ETAG if the etag has changed for directories 2013-11-15 13:53:18 +01:00
Klaas Freitag
c22f8a47f1 Initialise values properly, avoid warning. 2013-11-15 10:32:13 +01:00
Olivier Goffart
b3972a5ba8 Do not fetch the file id in the propagator with a HEAD
Normally, the fileid comes with the PUT or the GET.
If it did not comes with the PUT, it means the server do not support
fileid,  we should not query it with a useless HEAD.

Also, in case the fileid changes (which it should not)  update anyway
to the new fileid in the db
2013-11-15 10:18:19 +01:00
Olivier Goffart
e8e27b61f6 Revert the changes that fetch the file id in the propagator.
We don't want to fetch the file id in the propagator.

Revert "Put item member variable to base class."
This reverts commit f7aa2aa348.

Revert "Add isValidFileId and getFileIdPropget methods."
This reverts commit ccd254abba.
2013-11-14 14:59:03 +01:00
Klaas Freitag
ccd254abba Add isValidFileId and getFileIdPropget methods. 2013-11-14 11:37:08 +01:00
Klaas Freitag
2eb77445be Add rename actions to progress dispatching.
With that fix rename operations are shown as such in the progress
window and in bubble help etc.
2013-11-08 16:21:59 +01:00
Klaas Freitag
a458ffd472 Add missing return in error case. 2013-11-08 12:56:54 +01:00
Klaas Freitag
162acc1cc2 Fix conflict file handling, create a proper conflict file name.
Before this fix, the conflict file name was set in the file name
variable which lead to the problem that the subsequent rename of
the temp file to the final final filename was moving the temp file on
the conflict file. No final file was there.
2013-11-07 16:53:22 +01:00
Klaas Freitag
5cd2be058d Fix local rename. 2013-11-05 17:50:09 +01:00
Olivier Goffart
f0a1ac4346 Fix syncing folder with nothing in it
Do the start after connecting, as the finish may be imediate if there
is nothing to do.
2013-10-31 12:11:56 +01:00
Klaas Freitag
c66a1d1895 Removed unused code from LocalRename 2013-10-30 18:14:33 +01:00
Klaas Freitag
cdee0dc1cf Added a PropagateLocalRename job to do local renames. 2013-10-30 17:37:34 +01:00
Klaas Freitag
a43c5fcfe8 Fix header name according to changes on server master. 2013-10-30 17:37:34 +01:00
Olivier Goffart
5c67f39476 Ignore error 404 on DELETE
This may happen if we have stale entries in the database
2013-10-30 17:33:06 +01:00
Olivier Goffart
9500c5ffab Do not change the instruction anymore when we finish an item
The status is in the status.  Keep the original instruction so the
UI knows what to display for eath item
2013-10-30 10:46:05 +01:00
Olivier Goffart
6e088e28f5 Adjust the mtime in case of fake conflicts
"Fake conflicts" happen when the etag changes on the server, and the
mtime changes on the client,  but the actual file is still exactly
the same.  We correctly detect them as false conflict and we do not
generate the conflict file for them.
But we should also update the local mtime to the server mtime so future
sync don't get confused.
2013-10-29 12:23:51 +01:00
Olivier Goffart
01e2743bae Always download the conflicted files.
Conflicts have a direction==NONE. And they need to be downloaded, not uploaded
2013-10-29 12:13:30 +01:00
Olivier Goffart
75ffa787a6 emit the EndDownload progress at the right place.
It was put in rename instead of download
2013-10-29 12:13:30 +01:00
Olivier Goffart
adc47948a5 Add a comment explaining OwncloudPropagator::start 2013-10-28 17:00:27 +01:00
Olivier Goffart
6e886e28e9 Merge branch 'propagator-job'
Conflicts:
	src/mirall/owncloudpropagator.cpp
2013-10-28 16:26:25 +01:00
Olivier Goffart
84a40dcb59 Refactor the new propagator in jobs
This makes the code (IMHO) more easy to understand, and will allow
even more easy parallelism
2013-10-28 15:58:35 +01:00
Klaas Freitag
68ba99b7f0 Fixed fileID parsing and improved logging. 2013-10-28 15:28:34 +01:00
Klaas Freitag
17220f2604 Query file Id from server if unknown. 2013-10-25 13:31:00 +02:00
Klaas Freitag
7a68961b25 Add handling for the file_id data to the sync items. 2013-10-25 13:31:00 +02:00
Olivier Goffart
0efbfb10aa Fix MOVE of directory.
Remove the right entry from the database (i.e: the original file name)
Fetch the etags of the sub entries
2013-10-17 13:06:39 +02:00
Klaas Freitag
660469cbf5 Do not propagate a move of the Shared folder. 2013-10-17 10:48:31 +02:00
Olivier Goffart
746b86a1dd Save the progress db once a chunk has been upload
Allow to resume when we cancel the sync
2013-10-16 16:47:24 +02:00
Olivier Goffart
313832de8d Put the progress database within the journal 2013-10-16 12:01:14 +02:00
Klaas Freitag
1ed8afba09 Minor changes. 2013-10-09 14:27:28 +02:00
Olivier Goffart
7c6fcf688c Fix the fact that some success was reported as error 2013-10-04 15:55:59 +02:00
Olivier Goffart
127055dd70 Refactor a bit the error reporting from the propagator
Add different classes of error failures.
Fatal error means the sync should be stopped.
SoftErrors are not to be displayed to the user.

We still need to make a classification of the errors.
2013-10-04 15:55:59 +02:00
Olivier Goffart
baa9ba089c Save the database after each operation. 2013-10-03 22:41:12 +02:00
Olivier Goffart
3495b822a5 TMP 2013-10-03 20:01:07 +02:00
Klaas Freitag
0fef88a9b9 Some comments added. 2013-10-03 15:29:10 +02:00
Olivier Goffart
b18810f381 Implement abort with the new propagator
abort was implemented in csync after the new propagator was written,
so it was not working with the new propagator
2013-10-03 14:35:56 +02:00
Olivier Goffart
47f299f0ee Send the last known etag to the server in a If-Match header
That way we avoid race conditions in case the file changed between the
update and the reconcile
2013-10-02 15:57:49 +02:00
Olivier Goffart
d135aab86c clear the etag in every cases, not only when we upload files 2013-10-02 15:57:49 +02:00
Olivier Goffart
e2a2b882bb Remove the unused errorDetails
It was not displayed to the user. Only use errorString instead.

Also report neon error to the user
2013-10-02 15:57:49 +02:00
Klaas Freitag
de9dcbd231 Transmit the new mtime of the file with the PUT request.
If the server supports it already, we can save another request by
sending the mtime as a header value in the PUT request and check the
servers reply for a acknoledge header.
2013-09-25 14:26:13 +02:00
Daniel Molkentin
00d09763af Fix compile error 2013-09-10 11:37:52 +02:00
Daniel Molkentin
51a7cbeb55 kill warning 2013-09-05 20:15:55 +02:00
Daniel Molkentin
35ac6610c7 Compile with Qt5 on Linux 2013-09-05 17:13:31 +02:00
Olivier Goffart
3c2bb1e2bc Compile after the merge 2013-08-21 15:29:04 +02:00
Olivier Goffart
e4128cd5d8 progress with new propagator 2013-08-14 19:59:16 +02:00
Olivier Goffart
67c5f513aa Fix compilation after merge 2013-08-14 15:36:34 +02:00
Olivier Goffart
04f32bd397 Revert "TMP threaded"
This reverts commit 5bb4c3be43.
2013-08-14 14:59:32 +02:00
Olivier Goffart
5bb4c3be43 TMP threaded 2013-06-03 10:43:21 +02:00
Olivier Goffart
07ce6cfa79 don't use member variable of the propagator 2013-05-16 14:50:36 +02:00
Olivier Goffart
9ce47c9675 make the propagator asynchronous 2013-05-16 13:54:22 +02:00
Olivier Goffart
40255d643c propagator-ng: adapt to the merge of rename_folders branch 2013-05-15 15:22:20 +02:00
Olivier Goffart
b31200a6f2 propagator-ng: fix setting the mtime 2013-05-10 13:20:21 +02:00
Olivier Goffart
98cbb599b8 Fix handling of conflicting directories
We can safely ignore them in the propagator
2013-05-10 12:35:10 +02:00
Olivier Goffart
ecd314cef5 Give the tmp file a proper hidden and excluded name 2013-05-08 14:31:52 +02:00
Olivier Goffart
0b1ecd0ac6 propagator-ng: Abort on fatal error 2013-05-08 13:30:30 +02:00
Olivier Goffart
2193da0ab5 Fix a few FIXME 2013-05-07 17:47:29 +02:00
Olivier Goffart
7cd12e7dc5 remove some FIXME 2013-05-07 17:16:11 +02:00
Olivier Goffart
685bf395be propagator-ng: resume uploads
Currently i think it corrupt the files
2013-05-06 18:41:56 +02:00
Olivier Goffart
0636ae6f28 propagator-ng: be able to resume download 2013-05-06 16:59:11 +02:00
Olivier Goffart
7f8eba3700 propagator-ng: set the modtime on downloaded files 2013-05-06 12:09:21 +02:00
Klaas Freitag
2e53e2e4e0 Really return true in case of error. 2013-05-05 12:34:38 +02:00
Klaas Freitag
721a8f79ab Improve error handling, add error string to each individual file item. 2013-05-05 11:47:19 +02:00
Olivier Goffart
ecaf66db5d style: use _ in front of member variable 2013-05-05 11:32:12 +02:00
Olivier Goffart
0c775aba6d propagator-ng: get the etag also in the GET request 2013-05-05 11:32:12 +02:00
Olivier Goffart
71b238031f Fix compilation after previous rebase 2013-05-05 11:32:12 +02:00
Olivier Goffart
662bd4e5fe propagator-ng: handle conflict
Always download the file from the server.
And if they are equals, ignore the conflict
2013-05-05 11:17:42 +02:00
Klaas Freitag
c956d11183 More error handling of propagator, some cleanups. 2013-05-04 17:14:47 +02:00
Klaas Freitag
7df23a1b19 Proper error reporting of propagator - WIP 2013-05-04 17:14:47 +02:00
Olivier Goffart
264cc73806 Implement renaming on windows
(Not actually tested)
2013-05-04 16:18:13 +02:00
Olivier Goffart
c041076c95 Handle renames 2013-05-04 15:32:11 +02:00
Olivier Goffart
e1e8842548 New owncloud propagator that skip the vio abstraction layer
The vio abstraction layer within csync is inneficient for the owncloud
use case because not all calls maps well to the POSIX interface. We can
be much more efficient by doing exactly what we need.

Also, this will allow us to scedule better the calls and possibly to use
threads.
2013-05-04 11:02:30 +02:00