Commit graph

125 commits

Author SHA1 Message Date
Olivier Goffart
e74f0f2854 Better support when user remove or rename the Shared directory 2014-02-19 15:23:36 +01:00
Olivier Goffart
a51f050a08 More fix for moving shared directories
Abort a directory job if the first job fails

Also make sure the jobs are in the directory job of their destination paths
2014-02-19 13:08:35 +01:00
Olivier Goffart
a677f97b7f Fix removing and renaming directories from the Shared directory 2014-02-12 13:44:55 +01:00
Olivier Goffart
bb378902ae Also force an update of the etag in case of renames
Imagine we have a file:
  foo/bar/moo
if we do     mv 'foo' 'foo2' and that we issue a MOVE on the server
and will update the entry 'foo' in the database with the new etag
If we write the etag of foo but not the etag of the sub item, when
we read from db on the next sync, we will miss them and beleive they
have been removed on the server
2014-02-06 17:56:27 +01:00
Olivier Goffart
8f1494f8f2 Report an error if fetching the etag fails
Very important in case of renames, else, if the server did not perform
the rename, we may end up deleting the files
2014-02-06 17:56:27 +01:00
Klaas Freitag
ae5c9a29f6 Detect renames and removes in read only Shared directory, restore files.
This fixes bug #1386
2014-02-04 15:03:06 +01:00
Klaas Freitag
971caca5e8 Implement change of the network throttling during a running sync run. 2014-02-02 12:51:19 +01:00
Olivier Goffart
6540f54512 Don't use QDateTime::toTime_t or QDateTime::fromTime_t
They only take an uint, and time_t is 64bit.
This breaks when date are before 1970

Fixes #1380
2014-01-29 11:47:13 +01:00
Daniel Molkentin
562513d5a5 Propagator: Don't pass arbitrary strings as formating string
Not a security issue since this code was never in any release.
2014-01-20 17:22:29 +01:00
Olivier Goffart
6257ed6605 Make sure that the jobs have the Q_OBJECT macro.
so tr()  works there
2014-01-16 14:06:17 +01:00
Klaas Freitag
0455d96462 Fix untranslated error messages. 2014-01-16 13:04:57 +01:00
Olivier Goffart
ebee52ea8a Merge branch '1.5' 2014-01-09 12:32:08 +01:00
Olivier Goffart
1bc4089d95 Fix hiding temporary files on windows
tmpFileName is a relative path, and we need an absolute path to
pass to the function that hides the files
2014-01-08 13:33:16 +01:00
Olivier Goffart
b7b06a8795 Preserve the permission of the file we download
Related to issue #820
2014-01-08 13:17:35 +01:00
Olivier Goffart
4006e490f3 Do not write the removed folder on the DB
Should fix #1329
2014-01-08 12:51:42 +01:00
Klaas Freitag
273463daf4 Fix progress for the case that the source file changes during upload.
If the source file changes, the overall transmission size is not longer
correct. Fixed that by pushing the change over the previously calculated
size to csyncthread. Also set the mtime and size in the item object in
propagator to avoid doublicate uploading.
2014-01-07 15:42:21 +01:00
Klaas Freitag
09745c7f75 Fix: Allow to retry sync also for fatal err conditions.
Otherwise there would not  have been a chance to resync for example data
that was Forbidden because of a read only share.

Also removed some commented code.
2013-12-12 11:39:05 +01:00
Klaas Freitag
aa213eeafb Do not check for the ETag in case the HTTP request connected. 2013-12-11 13:51:38 +01:00
Klaas Freitag
b68e721f05 Do not error out on ETag if the status klass is != 2. 2013-12-11 12:59:11 +01:00
Olivier Goffart
bf309f83f4 Don't keep the temporary file if the transfer fails because of a wrong etag
The downloaded file is corrupted, remove it.
2013-12-11 12:48:11 +01:00
Daniel Molkentin
80d202c630 Fix build on Win32 2013-12-10 17:19:36 +01:00
Olivier Goffart
0360babe02 usleep is not working on windows, use QThread::usleep
Shoud fix #1082
2013-12-10 14:03:01 +01:00
Klaas Freitag
fc986b0ab8 If item is a directory, remove its contents from the database as well.
Fixes bug #1257
2013-12-06 16:38:43 +01:00
Klaas Freitag
6fad20d5fc Show local MOVE operations only for top level directory instead for all
files.

This fixes bug mirall#1240
2013-12-06 12:32:26 +01:00
Olivier Goffart
fa9d9c9909 Maybe we need to destroy the decompress context before the request.
Possibly fix the issue #1229
2013-12-05 16:51:39 +01:00
Klaas Freitag
b3620e320b Avoid a comparison warning on win32 2013-12-03 17:09:57 +01:00
Klaas Freitag
883576cb95 Fix Win32 move file operation. 2013-12-03 17:07:42 +01:00
Olivier Goffart
1f5c4bde14 Fix windows rename of temporary files 2013-12-03 16:10:44 +01:00
Olivier Goffart
09d850bfaa When the temporary file is the same size as the file we would download, just keep it
Don't download the file if the temporary file is complete.

else, we get error from server: Requested Range not satisfiable
2013-12-03 14:44:04 +01:00
Olivier Goffart
ef8fe11f5a Do not write the directory etag in the database in case of soft error
Else we won't retry next time as we think nothing has changed.
2013-11-28 10:01:30 +01:00
Olivier Goffart
30db533cea Stop iterating files when aborting. 2013-11-28 10:01:30 +01:00
Olivier Goffart
99eeaa0db5 no need to set twice the error string
done() is already taking care of that
2013-11-28 10:01:30 +01:00
Klaas Freitag
23007613a9 Fix progress bar in new propagator. 2013-11-27 16:48:16 +01:00
Klaas Freitag
232cbc45b5 Simplify progress and error signals again.
Now handle everything through the progress signal and let the errors
be progressed in the done slot.

Remove unused code, fix sorting of the list, more efficiency.

This fixes #916
2013-11-26 14:02:11 +01:00
Klaas Freitag
090e474d70 Add a couple of missing progress signals. 2013-11-26 14:02:11 +01:00
Klaas Freitag
4f7546768b Do not blacklist Softerrors. 2013-11-26 14:02:11 +01:00
Olivier Goffart
5c8b6ed902 Fix Remove -gzip from etag
Remove it from both "foo"-gzip  and "foo-gzip"

See issue #1195
2013-11-26 12:10:52 +01:00
Markus Goetz
fa715ce135 Propagator: Open download file as Unbuffered 2013-11-25 19:25:19 +01:00
Markus Goetz
911e0bdd6e Propagator: Check write errors when downloading 2013-11-25 19:25:19 +01:00
Olivier Goffart
fa0f773fcb Separate the case of file changing durng upload in the chunk or non chunk case.
If the file is changed between chunk, it is easy and we can just retry as the
file has not been changed on the server.
But if the file is changed after it has been updated on the server, we must still
update the database with the etag. (and possibly delete the partial file)

Relates to issue #1002
2013-11-25 19:16:54 +01:00
Markus Goetz
ac8296fb94 Propagator: Check E-Tag when resuming
Should fix #756
2013-11-25 19:01:04 +01:00
Olivier Goffart
ca3d8ab193 Add one case of missing -gzip removal 2013-11-25 17:48:57 +01:00
Markus Goetz
72d2ac09e3 Propagator: Don't ignore error if no HTTP error code 2013-11-25 16:37:48 +01:00
Olivier Goffart
6b7da798b8 Remove -gzip from Etag
Fix #1195
2013-11-25 16:30:13 +01:00
Klaas Freitag
dc29046d61 Add new progressProblem signal and slots.
Now the sync problems are handled differently than the sync progress
to ease error message handling and stuff.
2013-11-25 16:18:07 +01:00
Klaas Freitag
055a8d7e74 Do not display error messages if user aborts the sync run. 2013-11-24 22:26:50 +01:00
Klaas Freitag
ecb2444923 Handle changing source file in upload correctly.
Delete the file on the server if the source file is new, but
the source did not arrive completely within a timespan.
2013-11-22 19:45:26 +01:00
Klaas Freitag
55e82ee4c1 Made transaction management a bit more transparent. Some fixes. 2013-11-21 11:13:58 +01:00
Klaas Freitag
97c661c909 Cleanups 2013-11-20 14:59:58 +01:00
Klaas Freitag
5900b1ad25 Add blacklisting for files with error conditions. 2013-11-20 14:27:44 +01:00