Skip to content

Commit 8deef70

Browse files
committed
document how to resume downloads
1 parent e422151 commit 8deef70

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

doc/design/external_special_remote_protocol.mdwn

+23-12
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,16 @@ The following requests *must* all be supported by the special remote.
125125
* `PREPARE-FAILURE ErrorMsg`
126126
Sent as a response to PREPARE if the special remote cannot be used.
127127
* `TRANSFER STORE|RETRIEVE Key File`
128-
Requests the transfer of a key. For STORE, the File is the file to upload;
129-
for RETRIEVE the File is where to store the download.
130-
Note that the File should not influence the filename used on the remote.
131-
Note that in some cases, the File may contain whitespace.
132-
It's important that, while a Key is being stored, `CHECKPRESENT`
133-
not indicate it's present until all the data has been transferred.
128+
Requests the transfer of a key. This is the main thing a special remote
129+
does. For STORE, the File contains the content to upload;
130+
for RETRIEVE the File is where to store the content you download.
131+
When retrieving, the File may already exist, if its retieval was
132+
interrupted before. That lets the remote resume downloading, if it's able
133+
to.
134+
Note that the File should not influence the filename used on the remote;
135+
that filename should be based on the Key.
136+
Note that in some cases, the File's name may include whitespace or other
137+
special characters.
134138
While the transfer is running, the remote can send any number of
135139
`PROGRESS` messages to indicate its progress. It can also send any of the
136140
other special remote messages. Once the transfer is done, it finishes by
@@ -140,7 +144,10 @@ The following requests *must* all be supported by the special remote.
140144
* `TRANSFER-FAILURE STORE|RETRIEVE Key ErrorMsg`
141145
Indicates the transfer failed.
142146
* `CHECKPRESENT Key`
143-
Requests the remote to check if a key is present in it.
147+
Requests the remote to check if a key is present in it.
148+
It's important that, while a key is being transferred to a remote,
149+
`CHECKPRESENT` not indicate it's present in the remote until all
150+
the data has been sent.
144151
* `CHECKPRESENT-SUCCESS Key`
145152
Indicates that a key has been positively verified to be present in the
146153
remote.
@@ -270,13 +277,18 @@ handling a request.
270277
(git-annex does not send a reply to this message, but may give up if it
271278
doesn't support the necessary protocol version.)
272279
* `PROGRESS Int`
273-
Indicates the current progress of the transfer (in bytes). May be repeated
274-
any number of times during the transfer process, but it's wasteful to
275-
update the progress too frequently. Bear in mind that this is used both
280+
Indicates the current progress of the transfer. The Int is the
281+
number of bytes from the beginning of the file that have been
282+
transferred.
283+
May be repeated any number of times during the transfer
284+
process, but it's wasteful to update the progress too frequently.
285+
Bear in mind that this is used both
276286
to display a progress meter for the user, and for annex.stalldetection.
277287
So, sending an update on each 1% of the file may not be frequent enough,
278288
as it could appear to be a stall when transferring a large file.
279-
This is highly recommended for STORE. (It is optional but good for RETRIEVE.)
289+
This is highly recommended for STORE.
290+
(It is optional but good for RETRIEVE; git-annex will fall back to
291+
tracking the size of the file as it grows.)
280292
(git-annex does not send a reply to this message.)
281293
* `DIRHASH Key`
282294
Gets a two level hash associated with a Key. Something like "aB/Cd".
@@ -291,7 +303,6 @@ handling a request.
291303
creating hash directory structures to store Keys in. This is the same
292304
directory hash that is used by eg, the directory special remote.
293305
(git-annex replies with VALUE followed by the value.)
294-
(First supported by git-annex version 6.20160511.)
295306
* `SETCONFIG Setting Value`
296307
Sets one of the special remote's configuration settings.
297308
Normally this is sent during INITREMOTE, which allows these settings

0 commit comments

Comments
 (0)