1
0
Fork 0
Commit Graph

191 Commits

Author SHA1 Message Date
Christian Kamm 29b39acfbe PropagatorJob: Access propagator through function #5453 2017-01-17 14:47:38 +01:00
ckamm d76e0ec6d8 Reset stuck chunked uploads eventually #5344 (#5443)
Previously this wasn't happening for errors that were not
NormalErrors because they don't end up in the blacklist.

This revises the resetting logic to be independent of the
error blacklist and make use of UploadInfo::errorCount
instead.

412 errors should reset chunked uploads because they might be
indicative of a checksum error.

Additionally, server bugs might require that additional
errors cause an upload reset. To allow that, a new capability
is added that can be used to advise the client about this.
2017-01-13 14:44:45 +01:00
Olivier Goffart 4ac2b764a4 libsync: Clear the upload info after several retries (#5345)
Issue #5344
2016-12-05 17:21:36 +01:00
Olivier Goffart 19d2677db1 libsync: use the new webdav url if the server reports it
The rules to select the webdav url are now:

 - If the server reports that the new chunking algorithm is working,
   always use remote.php/dav/files/<username>
   This capability can be overriden with an environment variable

 - Otherwise, use the dav path provided by the theme, which defaults to
   remote.php/webdav

This means that with the newer server, the branding can no longer override
the webdav URL. If there is still an usecase for the branding to do so, we
need to find another way to override it. But it is now more complicated to
configure as might need include the username and need different endpoint
depending on the operations (chunks or not)

Issue #4007
2016-11-29 16:16:20 +01:00
Olivier Goffart d22d0e7e30 Propagator: don't use dynamic_cast for QObject
qobject_cast is better. (no need to use RTTI when we have QMetaObject
2016-11-22 17:37:41 +01:00
Olivier Goffart a1dc4069c9 libsync: Don't store the remote URI in the csync or in the SyncEngine
We are going to change the webdav path depending on the capabilities.
But the SyncEngine and csync might have been created before the capabilities
are retrieved.

The main raison why we gave the path to the sync engine was to pass it to csync.
But the thing is that csync don't need anymore this url as everything is done by the
discovery classes in libsync that use the network jobs that use the account for the urls.
So csync do not need the remote URI.

shortenFilename in folderstatusmodel.cpp was useless because the string is the
_file of a SyncFileItem which is the relative file name, that name never
starts with owncloud://.

All the csync test creates the folder because csync use to check if the folder
exists. But we don't need to do that anymore
2016-11-21 08:09:11 +01:00
Markus Goetz 52552a4204 Merge pull request #5102 from owncloud/chunking-ng
Chunking ng
2016-11-15 15:56:52 +01:00
Piotr M 34c59ba9ed reduce number of loops 2016-10-31 19:45:24 +01:00
Olivier Goffart e33b89c222 Chunking-NG: Enable if the server supports it 2016-10-21 16:42:27 +02:00
Olivier Goffart 0960058842 Merge remote-tracking branch 'origin/master' into chunking-ng 2016-10-20 09:25:03 +02:00
Markus Goetz 8c5ea8dc90 Propagator: Also upload more in parallel (#5230)
Fix for https://github.com/owncloud/client/issues/4986#issuecomment-227071801

This is before we have bundling at some point.
2016-10-14 14:23:55 +02:00
Olivier Goffart 85b8ab178e SyncEngine: Fix renaming of folder when file are changed (#5195)
Two bugs:
 - The change filed are not considered as move, they are re-downloaded
   but the old file was not removed from the database. The change in
   owncloudpropagator.cpp takes care of removing the old entries.

 - Next sync would then remove the file in the server in the old folder
   This was not a problem until we start reusing the sync engine, and
   that the _renamedFolders map is not cleared. We were before deleting
   a non-existing file. But now we delete the actual file.

Also improve the tests to be able to do move on the server.
This include support for file id.

Issue #5192
2016-09-22 09:02:47 +02:00
Olivier Goffart 98bfa8d5de Propagator: properly send the success flag (#5189)
In case of the root directory, it may happen that the _item
is empty and the _item->_status is NoStatus.  But we still need to report
the proper success or error of the whole propagation. We should really
use _hasError for that. However, _hasError is also defined to NoStatus
if there was no error, so in that case we need to set Success.

This fixes the problem in which the data-fingerprint is not saved on the
database because the SyncEngine think that the sync failed. (Issue #5185)
2016-09-21 16:35:42 +02:00
Olivier Goffart 79abb8b4e3 ChunkingNg: enable depending on an environment variable 2016-08-31 10:28:15 +02:00
Olivier Goffart 4f3f642da6 Upload: refactor the upload in two classes so the new chuning can be implemented 2016-08-31 10:28:15 +02:00
Olivier Goffart d2bde5489f Propagator, remove the QNAM in the name as the alternative has been removed a long time ago 2016-08-31 10:25:06 +02:00
Jocelyn Turcotte efb6b8c2c9 [overlays] Fix folders appearing as OK even though children are still syncing #4797
This would happen if the directory would first need to be created
through an mkdir propagation job. This job's itemCompleted signal
would trigger the directory to show as SYNC even though its children
are still propagating.

Fix the issue by tracking the sync count for each file, affecting
its parents. This allows us to get rid of the O(n) vector lookup
for each status query, and properly track the hierachical sync
status of a directory.

This also removes the itemCompleted signal emission from the
PropagateDirectory job. Since we only needed for overlay icons, and
since this job doesn't do any direct propagation, we can remove it
to ensure that we won't call itemCompleted twice for the item attached
to Propagate*Mkdir jobs (since the PropagateDirectory is backed by
the same SyncFileItem, instruction and status).
2016-08-17 15:40:02 +02:00
Jocelyn Turcotte e974771796 csync: Use an explicit instruction for should_update_metadata
The current way of tracking the need to update the metadata without
propagation using a separate flag makes it difficult to track
priorities between the local and remote tree. The logic is also
difficult to logically cover since the possibilities matrix isn't
100% covered, leaving the flag only used in a few situations
(mostly involving folders, but not only).

The reason we need to change this is to be able to track the sync
state of files for overlay icons. The instruction alone can't be
used since CSYNC_INSTRUCTION_SYNC is used for folders even though
they won't be propagated. Removing this logic is however not possible
without using something else than CSYNC_INSTRUCTION_NONE since too
many codepath interpret (rightfully) this as meaning "nothing to do".

This patch adds a new CSYNC_INSTRUCTION_UPDATE_METADATA instruction
to let the update and reconcile steps tell the SyncEngine to update
the metadata of a file without any propagation. Other flags are left
to be interpretted by the implementation as implicitly needing
metadata update or not, as this was already the case for most file
propagation jobs. For example, CSYNC_INSTRUCTION_NEW for directories
now also implicitly update the metadata.

Since it's not impossible for folders to emit CSYNC_INSTRUCTION_SYNC
or CSYNC_INSTRUCTION_CONFLICT, the corresponding code paths in the
sync engine have been removed.

Since the reconcile step can now know if the local tree needs metadata
update while the remote side might want propagation, the
localMetadataUpdate logic in SyncEngine::treewalkFile now simply use
a CSYNC_INSTRUCTION_UPDATE_METADATA for the local side, which is now
implemented as a different database query.
2016-08-17 15:39:31 +02:00
Olivier Goffart 88e5a9411a SyncEngine: Reads the data-fingerprint property (#5056)
When it changes, assume a backup was recovered, and keep conflict files.

Issues: #2325 and https://github.com/owncloud/enterprise/issues/966
2016-08-02 10:30:49 +02:00
Olivier Goffart 3465024898 CleanupPollsJob: Fix possible leak
Missing deleteLater when the CleanupPollsJob aborts.
This is only a problem if the SyncEngine is kept alive a long time. Which is
usually not the case in the configuration where poll jobs are used.
2016-07-14 09:23:22 +02:00
ckamm 28c12a3ca0 Move touched-files tracking to SyncEngine #4927 (#4946) 2016-06-09 12:07:18 +02:00
Christian Kamm ea40e314d4 Add server capabilities for checksums #4638
* Add checksums/supportedTypes and checksums/preferredUploadType
  capabilities. The default is that no checksum types are supported.

* Remove the transmissionChecksum config option. Servers must now
  use the capabilities to indicate that they are fine with the
  client sending checksums.

Note: This intentionally breaks brandings that overrode
Theme::transmissionChecksum. The override must be removed and the
server's capabilities must be adjusted to include the new values.
2016-04-15 10:58:14 +02:00
Klaas Freitag 6cb94e8849 Merge pull request #4656 from owncloud/close_journal_fix
Close journal fix - do not keep the journal open or reopen on error.
2016-04-11 16:14:17 +02:00
Klaas Freitag d433c24186 Check if the record returned from getFileRecord is valid.
Handle database fails properly.
2016-04-11 16:04:20 +02:00
Olivier Goffart 6ee7e82913 Handle setFileRecord errors #4632 2016-04-11 14:11:11 +02:00
Markus Goetz d78c3679e7 Propagator: Pump in more requests if we think current ones are quick
Helps with small file sync #331
When I benchmarked this, it went up to 6 parallelism and
was about 1/3 faster than the previous fixed 3 parallelism.
Doing more than 6 is dangerous because QNAM limits to 6 TCP
connections and also the server might become a bottleneck.

Should also help for #4081
2016-03-02 15:22:21 +01:00
Markus Goetz fe7630954e Propagator: Remove 100msec delay between jobs 2016-02-23 14:27:35 +01:00
Olivier Goffart d12c0939b9 Upload: Chunk size can be changed in the config file
Added a new "chunkSize" entry in the General group of the owncloud.cfg
which can be set to the size, in bytes, of the chunks.

This allow user with hude bandwidth to select more optimal chunk size

Issue #4354
2016-01-15 13:16:52 +01:00
Christian Kamm abf5a5ad1e Propagation: Fix dir <-> file changes propagating to server #4302
* Ensure every time a file becomes a directory or the other way around
  the item is flagged as INSTRUCTION_TYPE_CHANGE.
* Delete the badly-typed entity if necessary in the propagation jobs.
2016-01-08 05:38:08 +01:00
Christian Kamm d4b6b5cb1d Propagator: Remove warning when moving out of deleted folder 2016-01-08 05:38:08 +01:00
Jocelyn Turcotte 2f355c473a Don't show parent folders in the error list #3796
The error status of children should only be used for the etag logic.
The SocketApi uses a path matching system to do this and the UI should
report errors only for individual involved files/directories.
2016-01-06 12:37:35 +01:00
Jocelyn Turcotte 6e3809528e Fix OK statuses not being broadcasted during a sync #3944
Since the presence of any path in SyncEngine::_syncedItems
would translate in a SYNC status, platforms that don't refresh
all their status cache after an UPDATE_VIEW message like OS X
or Windows would keep displaying that status even after all
files are successfully synchronized.

- Read SyncFileItem::_status to determine the status to display mid-sync
- Match moved paths also to _renameTarget since this might be the
  path to match
- Make sure that PropagateDirectory jobs also set SyncFileItem::_status
  properly
2016-01-05 15:08:26 +01:00
Christian Kamm d4edab02b0 Propagator: Deal with directories becoming files #4302
Note, in particular the revised order of directory deletion jobs.
2016-01-05 10:26:41 +01:00
Christian Kamm 5cc4c03b6a Propagator: Deal with files becoming directories #4302
This needed adjustments in reconcile, to mark the item as SYNC
as well as additions to the LocalMkdir job.
2016-01-05 10:26:41 +01:00
Christian Kamm 17dd199cba Checksums: Treat more carefully in db #4034
In particular, preserve them on local rename or remote move.
2015-11-10 15:05:00 +01:00
Christian Kamm 8f7dbe71a1 CleanupPollsJobs: Preserve more journal data 2015-11-10 14:26:25 +01:00
Christian Kamm 76d9b9c0e2 Rename env variables to include unit #2939 2015-11-10 12:07:10 +01:00
ckamm 251679253a Merge pull request #3951 from ckamm/checksum
Checksums stored in database #3735
2015-10-29 10:40:24 +01:00
Christian Kamm 9788055147 Propagator: Add blacklisting of disk space errors #2939 2015-10-29 09:36:59 +01:00
Christian Kamm 5ea09d2668 Checksum: Disallow ADLER32, use Adler32 #3735 2015-10-28 09:59:33 +01:00
Markus Goetz c8590c4468 Remove legacy propagator and neon
The code was already uneeded/unbuilt on Windows and OS X.
2015-10-20 17:57:43 +02:00
Phil Davis f0e17fd9c0 libtypos comment and message typos for master 2015-10-05 09:05:09 +05:45
Christian Kamm efefc2d986 Merge branch '2.0'
Conflicts:
	doc/images/menu.png
	doc/images/settings_network.png
2015-10-02 15:44:50 +02:00
Christian Kamm 36e8e9ebf5 Propagator: Download disk space checks #2939
* There's a critical 50 MB threshold under which syncs abort
  (OWNCLOUD_CRITICAL_FREE_SPACE)
* The sync client always keeps 250 MB free
  (OWNCLOUD_FREE_SPACE)
2015-10-01 12:59:05 +02:00
Christian Kamm ef0ab93e05 Propagator: Simplify sub job finished counting #3844 2015-09-17 10:12:23 +02:00
Klaas Freitag 16d6418d10 Use a themable WebDAV path all over.
This is needed for enterprise#481
2015-09-10 13:04:26 +02:00
Daniel Molkentin 66f340734c Consistency: Use folder instead of directory in user visible strings 2015-09-07 08:51:40 +02:00
Christian Kamm 5bd631e8e7 Rename jobCompleted -> itemCompleted.
Because that's what's going on. A job can 'complete an item' or 'finish'.
Note that several jobs could complete the same item: a new directory
will complete on the PropagateRemoteMkdir and the PropagateDirectory
jobs.
2015-08-11 15:19:09 +02:00
Christian Kamm fe42c1a818 Activity: Skip PropagateDirectory jobs #3580
Previously, PropagateDirectory jobs didn't emit the completed() signal.
Now that they do, we need to make sure to not add extra lines to the
protocol widget for them.

To accomplish that, the jobCompleted() signal now also contains the job
that completed the item.
2015-08-11 15:19:09 +02:00
Markus Goetz 7c52e925b9 Propagator: Use fetchAndAddAcquire to get parallelism 2015-08-06 18:13:48 +02:00
Markus Goetz 593aa003d6 Propagator: Re-order statement of previous commit
The user should be allowed to override.
For issue #3382
Will also help for #3095
2015-08-06 15:28:50 +02:00
Olivier Goffart 29d7903c22 Propagator: do not use parallelism when we have bandwidth limit
When user wants to limit the bandwidth, he does not care about speed
anymore. And parallelism on slow network might cause problems.

For issue #3382
Will also help for #3095

(cherry picked from commit b20f29f22797367c7aa92bd74389c99b10c852a4)
2015-08-06 15:27:18 +02:00
Jocelyn Turcotte 48624fe033 SocketApi: Force fowarding an OK STATUS for all parent directories
This fixes a few issues with the new FinderSync integration on OSX which
can't easily clear its status cache when receiving an UPDATE_VIEW message
except by unregistering the folder, but which causes flickering.

This fix should also make the regeneration of the cache unnecessary on other
platforms through possibly expensive RETRIEVE_FILE_STATUS commands.
2015-07-31 21:59:58 +02:00
Olivier Goffart 45180a024d Rename should_update_etag to should_update_metadata
This should avoid some confusion
2015-07-09 15:05:37 +02:00
Olivier Goffart 6b27d2e703 Merge remote-tracking branch 'origin/1.8' 2015-05-26 12:28:31 +02:00
Klaas Freitag dec3bd4a02 Some more minor cleanups based on the pull request review. 2015-05-20 22:44:12 +02:00
Klaas Freitag dd6c97abb6 Propagator: Added a log that tells if transmission checksumming is used. 2015-05-20 12:27:54 +02:00
Jocelyn Turcotte 12d7484b85 Pass SyncFileItems by pointer instead of by value
Use a QSharedPointer to keep the same ownership and
continue passing the SyncFileItems as a const& when
ownership isn't taken. This allows sharing the same
allocations between the jobs and the result vectors.

This saves about 20MB of memory (off 120MB) once all
jobs are created.
2015-04-18 14:26:40 +02:00
Markus Goetz ef89582d7e Propagator: Fix compile 2015-03-30 08:41:53 +02:00
Christian Kamm 2578832002 Fix clang warnings about deleting incomplete 'Account'. 2015-03-27 11:11:44 +01:00
Markus Goetz 3b12b9d81d Revert "Propagator: Delete job on finish"
Needs a bit more thinking.

This reverts commit 8746914f3b.
2015-03-09 16:19:16 +01:00
Markus Goetz 8746914f3b Propagator: Delete job on finish 2015-03-09 15:41:43 +01:00
Volkan Gezer bd4f68233f some typos, grammar and sentence fixes 2015-02-14 23:47:07 +01:00
Olivier Goffart 0184a00151 PropagateDirectory: make the code a bit more readable
Do not call slotSubJobFinished when there is are no sub jobs because
no sub jobs were finished.  Instead just call a finalize method
2015-02-12 20:00:04 +01:00
Olivier Goffart b9161aa06c libsync: Fix a case in which canceling the sync would result in some folder never being sync'ed
The problem occurs because of the sorting of items when we have things like

bigfolder
bigfolder/bigsubfolder
bigfolder-2

Then, because dashes come before slash in ascii, the bigfolder-2 would come before its content
and the propagator would thinkg bigfolder is empty and save the etag before it is processed

Should fix issue #2832
2015-02-12 20:00:04 +01:00
Olivier Goffart fe51ada1e8 Don't require NEON with Qt 5.4 2015-01-23 17:11:34 +01:00
Christian Kamm 91fce3ea73 Make public API explicit about blacklist kind. #2301
'blacklist' can mean the selective sync blacklist or the error
blacklist. Names in public API are now explicit about which
blacklist is meant.
2015-01-16 10:17:19 +01:00
Christian Kamm 38ebfec1fb Use global Account/AccountState less.
* Use a shared pointer to Account everywhere to ensure
  the instance stays alive long enough for a sync to terminate
* Folder is now tied to an AccountState
* SyncEngine and OwncloudPropagator tie to an Account and use that
  for all jobs they run

Issue: Since the setup wizard currently always replaces the
account, it will always wipe all folder definitions, even when
the actual changes to the account were minor.
2014-12-18 15:39:51 +01:00
Christian Kamm 53d5de685c Merge remote-tracking branch 'origin/1.7'
Conflicts:
	src/gui/folder.cpp
	src/gui/folder.h
	src/libsync/networkjobs.cpp
	src/libsync/owncloudpropagator.h
	src/libsync/propagatedownload.cpp
2014-12-10 13:01:36 +01:00
Daniel Molkentin 3016844dd7 Merge branch 'master' into rename_client
Conflicts:
	README.md
	src/gui/folderman.cpp
	src/gui/settingsdialog.cpp
	src/libsync/accessmanager.cpp
	src/libsync/propagateupload.h
2014-12-02 13:37:22 +01:00
Olivier Goffart fc3a8b944e Propagator: Don't forget to mark the direcotry as finished if its first job fails
Otherwise we would go ahead and propagate the content of the directory
2014-11-27 15:36:13 +01:00
Christian Kamm 0fe7a69b39 FolderWatcher: Detect own changes. #2297 2014-11-20 13:16:29 +01:00
Christian Kamm 3706c76622 useLegacyJobs: Fix logic. 2014-11-19 10:31:42 +01:00
Olivier Goffart 1113980b20 Propagator: Change the scheduler
It still needs to be a bit optimized, but it allows to paralelized jobs between directories

(this is required to paralelize the mkcol)
2014-11-18 17:35:31 +01:00
Olivier Goffart a3b21022af new bandwith limiting: Do a test on the Qt version to activate it
We need Qt 5.3.3.
If the compiled qt version is Qt 5 but smaller than Qt 5.3.3, do a runtime
check.

OWNCLOUD_NEW_BANDWIDTH_LIMITING is still there for a special setup in which
we patch Qt with the patches
2014-11-14 17:29:28 +01:00
Olivier Goffart 1310bef528 Port the propagate mkdir to QNAM
This way we can make it parallel
2014-11-13 18:57:07 +01:00
Daniel Molkentin 281c0e1553 Merge branch 'master' into rename_client
Conflicts:
	CMakeLists.txt
	src/gui/main.cpp
	src/libsync/accessmanager.cpp
	src/libsync/accessmanager.h
	src/libsync/owncloudpropagator_p.h
2014-11-12 00:07:59 +01:00
Olivier Goffart c712b7c46c Parallel MOVE by porting the job to qnam 2014-11-11 16:09:01 +01:00
Olivier Goffart 134650eb44 Parallel DELETE 2014-11-11 13:19:29 +01:00
Olivier Goffart 506ba022f1 Split propagator_qnam.cpp into propagateupload.cpp and propagatedownload.cpp 2014-11-11 12:17:10 +01:00
Klaas Freitag fc6d572a6c Make compile against Qt4 2014-11-11 10:10:46 +01:00
Daniel Molkentin 2db17a57d2 Fix header names 2014-11-09 23:25:57 +01:00
Daniel Molkentin ae85aa33fd Adjust namespaces 2014-11-09 22:34:07 +01:00
Daniel Molkentin f2eadacf09 Remove "Mirall" from class names 2014-11-09 22:30:29 +01:00
Olivier Goffart de11f602d5 Merge remote-tracking branch 'origin/il'
Conflicts:
	csync/src/csync_private.h
	src/CMakeLists.txt
	src/gui/folder.cpp
	src/libsync/owncloudpropagator.cpp
	src/libsync/owncloudpropagator.h
	src/libsync/propagator_qnam.cpp
	src/libsync/propagator_qnam.h
	src/libsync/syncengine.cpp
	src/libsync/syncengine.h
	src/mirall/syncjournaldb.cpp
2014-11-08 10:48:36 +01:00
Christian Kamm a20375372d Blacklist: Don't ignore error files forever. #2247
Instead try them again regularly, but don't show the user any
error messages if the error persists.
2014-10-22 12:25:18 +02:00
Christian Kamm 7ae0338f5c Merge remote-tracking branch 'origin/1.7'
Conflicts:
	src/CMakeLists.txt
	src/cmd/cmd.cpp
	src/gui/socketapi.h
	src/libsync/syncengine.h
	test/CMakeLists.txt
2014-10-22 10:41:55 +02:00
Olivier Goffart 50e718b1e7 Merge branch '1.7'
Conflicts:
	src/CMakeLists.txt
	src/cmd/cmd.cpp
	src/gui/folder.cpp
	src/gui/socketapi.cpp
	translations/mirall_ca.ts
	translations/mirall_cs.ts
	translations/mirall_de.ts
	translations/mirall_el.ts
	translations/mirall_en.ts
	translations/mirall_es.ts
	translations/mirall_es_AR.ts
	translations/mirall_et.ts
	translations/mirall_eu.ts
	translations/mirall_fa.ts
	translations/mirall_fi.ts
	translations/mirall_fr.ts
	translations/mirall_gl.ts
	translations/mirall_hu.ts
	translations/mirall_it.ts
	translations/mirall_ja.ts
	translations/mirall_nl.ts
	translations/mirall_pl.ts
	translations/mirall_pt.ts
	translations/mirall_pt_BR.ts
	translations/mirall_ru.ts
	translations/mirall_sk.ts
	translations/mirall_sl.ts
	translations/mirall_sv.ts
	translations/mirall_th.ts
	translations/mirall_tr.ts
	translations/mirall_uk.ts
	translations/mirall_zh_CN.ts
	translations/mirall_zh_TW.ts
2014-09-18 17:10:21 +02:00
Daniel Molkentin 902bb7a198 Merge remote-tracking branch 'origin/master' into move_lib_to_sep_dir
Conflicts:
	src/CMakeLists.txt
	src/gui/accountsettings.cpp
	src/gui/folderwizard.cpp
	src/gui/settingsdialog.cpp
	src/libsync/syncengine.h
2014-08-26 11:29:42 +02:00
Daniel Molkentin 4fc044d368 Merge branch 'master' into move_lib_to_sep_dir
Conflicts:
	cmake/modules/NSIS.template.in
	src/CMakeLists.txt
	src/creds/shibboleth/authenticationdialog.cpp
	src/creds/shibboleth/authenticationdialog.h
	src/gui/owncloudgui.cpp
	src/libsync/creds/shibboleth/authenticationdialog.cpp
	src/libsync/creds/shibboleth/authenticationdialog.h
	src/libsync/mirallaccessmanager.cpp
	src/mirall/authenticationdialog.cpp
	src/mirall/authenticationdialog.h
2014-08-12 21:08:44 +02:00
Daniel Molkentin df3c3bca02 Split into three separate projects: library, gui and cmd 2014-07-11 11:07:31 +02:00