15 November 1999 The sreRsync pre-reply procedure. Abstract: The sreRsync pre-reply procedure for SRE-http implements rsync differencing as a form of content-encoding. Introduction: Rsync differencing is a protocol that allows a server to return a "difference" file, defined as the difference between a current "instance" of a resource (that resides on the server), and an older "instance" of thie resource (that the client owns). Unlike other "delta encoding" techniques, Rsync does NOT require that the client and server both have an exact copy of this old instance. Instead, the client sends a mid-sized (about 500 bytes) synopsis of the prior instance to the server, and the server uses this information to compute the difference file. In other words, instead of using the actual contents of the prior instance, the server uses a synopsis of a prior instance. Although the end result (the difference file) from this comparision will usually be larger then a difference file between the actual instances, the benefit is the removal of server's need to maintain a (potentially huge) backlog of "prior instances". Installation: To use sreRsync, you must have the rxRSYNC.DLL dynamic link library. This can be obtained from http://www.srehttp.org/apps/rxrsync. Once you've obtain rxRSYNC.DLL, copy it to your GoServe directory, or to a directory in your LIBPATH (say, x:\os2\dll directory, where x: is your os/2 boot drive). To install sreRsync.cmd: a) copy sreRsync.cmd to your GoServe data directory. b) set the PRE_REPLY_PROCEDURE (in INIT_STA.80) to be sreRsync.cmd. Alternatively, set PRE_REPLY_PROCEDURE='!sreRsync.cmd', and then use SET PRE_REPLY 1 "advanced options" for selectors you want to be subject to Rsync differencing. c) restart Goserve SRE-http will now automatically detect, and appropriately respond to, requests that contain Rsync information. In particular, sreRsync looks for a Rsync-signature: request header. Rsync-signature can take two kinds of value, which cause the following response by sreRsync: a) Rsync-signature: 0 Create an rsync-signature of the response. This can be used (in an Rsync-signature request header) by the client in a future request b) Rsync-signature: long_strip_of_base64_characters Compute a difference file using the "current instance" of the resource (i.e.; the value of the "content" argument) and the "synopsis" contained in the long_string_of_base64_characters. This difference will be returned to the client, along with a Content-encoding: rsync-sre response header. Notes: * DOGET.CMD can be used to test Rsync differencing -- DOGET.CMD can automatically create a synopsis of a chosen "prior instance", and include it in an Rsync-signature request header. Also, DOGET.CMD will check for a "content-encoding: rsync-sre" response header, and automatically compute the new instance by "rsync undifferencing" the response contents against the prior instance. * For more details on rsync, see http://www.samba.org/rsync * For more details on sre-http's implementation of Rsync, see the RxRSYNC addon (at http://www.srehttp.org/apps/rxrsync). * For details SRE-http's pre-reply procedures, see PREREPLY.DOC. * For a discussion of the "delta encoding" standard and SRE-http, see DELTA.DOC.