Commit Graph

13 Commits

Author SHA1 Message Date
Christian Kamm
ed71bb7cb9 Checksums: Explicitly close file before reporting result
To ensure it's no longer open when the finished signal fires.
2019-09-23 17:42:29 +02:00
Christian Kamm
53cca17715 Checksums: Add back QIODevice api
Because the winvfs plugin needs it. But be more careful about the
device's lifetime this time.
2019-08-15 15:29:11 +02:00
Christian Kamm
224129957b Download: Don't trigger too many concurrent hash computations
Previously the job would only become "active" when the downloads
started. That meant that arbitrarily many hash computations could be
queued at the same time.

Since the the file was opened during future creation this could lead to
a "too many open files" problem if there were lots of new-new conflicts.

To change this:
- Make PropagateDownload become active when computing a hash
  asynchronously.
- Make the computation future open the file only once it gets run. This
  will make it less likely for this problem to occur even if thousands
  of these futures are queued.

For #7372
2019-08-12 12:27:59 +02:00
Christian Kamm
0f606229f2 Checksums: Fix crash due to threading issue
The checksum computation thread was potentially using a QFile that was
deleted in the gui thread.

For #7368
2019-08-07 21:22:48 +02:00
Christian Kamm
dac2801d67 Checksums: Make file ownership more explicit 2018-11-26 13:02:48 +01:00
Christian Kamm
12c3b9e718 Checksums: Work on QIODevice*s
Needed for cfapi where we want to feed data through a custom device
which retrieves data from the windows api.
2018-11-26 12:47:31 +01:00
Olivier Goffart
e448f5ef0f Checksum: Add support for SHA256 and SHA3
In case, some day, the server also supports it
2018-08-31 10:41:32 +02:00
Olivier Goffart
22d38db28b Move the checksum related routine from FileSystem to checksum, where they belong 2018-08-31 10:41:32 +02:00
Olivier Goffart
480932a58a Checksum: Ignore unkown OC-Checksum header when downloading...
And if there are several checksums, pick the "best" one.

The case of several checksum was reported in
https://github.com/nextcloud/client_theming/issues/213
2017-11-20 10:51:15 +01:00
Olivier Goffart
a9761a8976 Use qEnvironmentVariable* instead of qgetenv when appropriate
Now that we use Qt5, we should do that. It is slightly more efficient
and declares the intent.
(Modified using clazy)
2017-10-19 13:57:49 +02:00
Christian Kamm
3f7b3ca962 Checksums: Improve logging and add global disable #5017 2017-10-13 13:08:20 +02:00
Olivier Goffart
ff4213b59f Use the Qt5 connection syntax (automated with clazy)
This is motivated by the fact that QMetaObject::noralizeSignature takes 7.35%
CPU of the LargeSyncBench. (Mostly from ABstractNetworkJob::setupConnections and
PropagateUploadFileV1::startNextChunk). It could be fixed by using normalized
signature in the connection statement, but i tought it was a good oportunity
to modernize the code.

This commit only contains calls that were automatically converted with clazy.
2017-09-21 14:05:39 +02:00
Jocelyn Turcotte
a1f1775d15 Move SyncJournalDB to src/common 2017-09-18 14:00:52 +02:00