-
Notifications
You must be signed in to change notification settings - Fork 168
Document checksums #2964
Comments
@guruz Please review and feel free to edit above as needed. |
I'm too afraid to edit as there is no version control in comments (is there?)
Remove and replace all this with "..." ?
This sounds like it computes multiple of them?
spelling
You mean compares AFTER the last chunk right? When merging the chunks? Otherwise looks good to me, I wonder if this is blog material too? ( @hodyroff ) |
@guruz It does 😎 |
@IljaN, so, what you're after is for this to be added, as-is, to the docs, and where in the docs do you want it added? |
With 10.0 we implemented a checksum feature which checks the file-integrity on upload and download by computing a checksum after the file-transfer is finished.
Desktop Sync-Client
Checksum Algorithm Negotiation
The client queries the server capabilities after login to decide which checksum algorithm to use.
Currently SHA1 is hard-coded in the official server-release and can`t be changed by the end-user. Note that the server additionally also supports MD5 and ADLER32 but the desktop client will always use the checksum algorithm announced in the capabilities:
GET http://localhost:8000/ocs/v1.php/cloud/capabilities?format=json
Upload
A checksum is calculated with the previously negotiated algorithm by the client and sent along with the file in a HTTP-Header.
OC-Checksum: [algorithm]:[checksum]
During file upload the server computes SHA1, MD5 and ADLER32 checksums and compares one of them to the checksum supplied by the client.
On mismatch the server returns HTTP-Statuscode 400 (Bad Request) thus signaling the client that the upload failed. The upload is discarded by the server. and the file is blacklisted by the client:
The client retries the upload using exponential back-off. On success (matching checksum) the computed checksums are stored by the server in oc_filecache alongside the file.
Chunked Upload
Mostly same as above. The checksum of the full file is sent with every chunk, but the servery compares the checksum of the last chunk.
Download
The server sends the checksum in a http header with the file. (same format as above).
If no checksum is found in oc_filecache (freshly mounted external storage) it is computed and stored in oc_filecache on first download. The checksum is then provided on all subsequent downloads but not on the first.
The text was updated successfully, but these errors were encountered: