3.3.4.4.6.1 Requesting a Staging File
On receiving CMD_REMOTE_CO, if the downstream partner determines that a staging file is needed (see section 3.3.4.4.6), the downstream partner MUST request the staging file by CMD_SEND_STAGE packet through FrsRpcSendCommPkt.
The server MUST construct the CMD_SEND_STAGE packet as follows.
COMM_COMMAND: MUST be 0x228 (CMD_SEND_STAGE).
COMM_JOIN_GUID: MUST be P_IN.COMM_JOIN_GUID.
COMM_LAST_JOIN_TIME: MUST be P_IN.COMM_LAST_JOIN_TIME.
COMM_BLOCK_SIZE: MUST be 0.
If this is the first CMD_SEND_STAGE request to request the beginning of the staging file, then COMM_FILE_SIZE MUST be 0.
Otherwise, COMM_FILE_SIZE MUST be the file size, which is returned from the first CMD_RECEIVING_STAGE.
COMM_FILE_OFFSET: MUST be set to n*0x100, where n is the sequence number of the request, starting from 0 (0, 0x100, 0x200 …until n*0x100).
COMM_CO_GUID: MUST be CO_IN.ChangeOrderGuid.
COMM_CO_SEQUENCE_NUMBER: MUST be 0.
COMM_CO_EXTENSION_2: If the CMD_REMOTE_CO packet is for an existing file, the Data field in DATA_EXTENSION_CHECKSUM SHOULD be set as specified in section 2.2.3.7. Otherwise, the Data field SHOULD be set to NULL.
CO_OUT.Flags:
When copying files.
-
Compressed staging file: MUST be a bitwise OR of the following flags:
CO_FLAG_VVJOIN_TO_ORIG
CO_FLAG_COMPRESSED_STAGE
CO_FLAG_NEW_FILE
CO_FLAG_LOCATION_CMD
CO_FLAG_CONTENT_CMD
Uncompressed staging file: MUST be a bitwise OR of the following flags:
CO_FLAG_VVJOIN_TO_ORIG
CO_FLAG_NEW_FILE
CO_FLAG_LOCATION_CMD
CO_FLAG_CONTENT_CMD
-
Compressed staging file: MUST be a bitwise OR of the following flags:
CO_FLAG_COMPRESSED_STAGE
CO_FLAG_NEW_FILE (if a new file)
CO_FLAG_LOCATION_CMD
CO_FLAG_CONTENT_CMD
Uncompressed staging file: MUST be a bitwise OR of the following flags:
CO_FLAG_NEW_FILE (if a new file)
CO_FLAG_LOCATION_CMD
CO_FLAG_CONTENT_CMD
When renaming existing file.
Normal Sync:
Compressed staging file: MUST be a bitwise OR of the following flags:
CO_FLAG_COMPRESSED_STAGE
CO_FLAG_CONTENT_CMD
Uncompressed staging file: MUST be a bitwise OR of the following flags:
CO_FLAG_CONTENT_CMD
When copying folder.
Initial Sync: MUST be a bitwise OR of the following flags:
CO_FLAG_VVJOIN_TO_ORIG
CO_FLAG_NEW_FILE
CO_FLAG_LOCATION_CMD
Normal Sync: MUST be a bitwise OR of the following flags:
Compressed staging file:
CO_FLAG_COMPRESSED_STAGE
CO_FLAG_NEW_FILE (if a new folder)
CO_FLAG_LOCATION_CMD
Uncompressed staging file: MUST be a bitwise OR of the following flags:
CO_FLAG_NEW_FILE (if a new folder)
CO_FLAG_LOCATION_CMD
When renaming existing folder in the same replica set.
Normal Sync:
Compressed staging file: MUST be a bitwise OR of the following flags:
CO_FLAG_COMPRESSED_STAGE
CO_FLAG_CONTENT_CMD
Uncompressed staging file:
CO_FLAG_CONTENT_CMD
CO_OUT.IFlags: MUST be 0.
CO_OUT.State:
Initial Sync: MUST be 5 (allocating staging file space for remote change order).
Normal Sync: MUST be 6 (remote change order staging file fetch has started).
CO_OUT.ContentCmd:
Copying file: MUST be 0x2 (REASON_DATA_EXTEND).
Renaming existing file or folder: MUST be 0x2000 (REASON_RENAME_NEW_FILE).
Copying folder: MUST be 0.
LocationCmd: MUST be CO_IN.LocationCmd.
CO_OUT.FIleOffset: MUST be 0.