Protocol Definition

The protocol of SmartSync uses one single HTTP post request for synchronization. To be
independent of the architecture, no serialized java objects are used for
communication. The following sections describe the applicational protocol, i.e. the
structure of the data stream of request and response.

Commands

The overall structure of the protocol is a list of commands in the request and in the
response. One single command is coded in latin1 with a end of line sequence of \n\r. Each
command consists of a single line command verb, an unordered list of parameters (each on
one line) followed by an empty line and an optional content stream. The command handler
must be able to read to the end of the content stream, where the next command verb starts.
The last command in the stream is always a command with the verb "done".

A command parameter consists of the name of the parameter followed by ":",
followed by the value of the parameter. Here comes an example of a list of two commands
terminated with the done command:

Notice that "done" s a complete command with (possibly) no parameter. It has
two end-of-line sequences after the command verb, one that terminates the verb and one
that terminates the empty parameter list.

File Names

Files are always named with its path, which is relative to a document root (e.g.
reference directory or work directory). The separation character of the path elements is
'/' independent of the platform. Directory references like '.' or '..' are illegal. Path
elements cannot contain any of the following characters:

/ \ : * ? " >
< |

Depending on the platform, more illegal characters may be added. Files that are
directly located in a document root have no path. The following examples are legal file
names:

a
.b
a b.txt
d/e f/g.txt

Request

The easiest way to describe a request is to start with an example request:

Specifies true or false, specifies
whether the task summary should be included or not.

compression-flag

Specifies true or false, specifies
whether gzip compression should be used or not. If this flag is set to true,
the following commands of the request and the whole response is compressed using a
gzip stream.

Stream

No stream data

work-files

file-count

Specifies the number of work file definitions contained in
the following stream.

Stream

A list of work file definitions. One single file definition
consists of the following fields separated by a "|"

The file name and path

The size of the file coded in decimal notation

The crc32 checksum over the file content coded in hexadecimal notation

The modification time of the file coded in decimal notation representing the number of
ms after 1.1.1970 00:00.

archive-files

file-count

Specifies the number of archive file definitions contained
in the following stream.

Stream

A list of archive file definitions. One single file
definition consists of the following fields separated by a "|"

The file name and path

The size of the file coded in decimal notation

The crc32 checksum over the file content coded in hexadecimal notation

The modification time of the file coded in decimal notation representing the number of
ms after 1.1.1970 00:00.