Hex Artifact Content
Not logged in

Artifact 4b7a0c18217f58fb6793f31988683bbd915c5d3f:

File www/sync.html part of check-in [f76192b245] - Pulled the latest CLI, website, and sqlite changes into the importer branch. by aku on 2007-09-17 01:00:32.

0000: 3c 68 74 6d 6c 3e 0a 3c 68 65 61 64 3e 0a 3c 74  <html>.<head>.<t
0010: 69 74 6c 65 3e 54 68 65 20 46 6f 73 73 69 6c 20  itle>The Fossil 
0020: 53 79 6e 63 20 50 72 6f 74 6f 63 6f 6c 3c 2f 74  Sync Protocol</t
0030: 69 74 6c 65 3e 0a 3c 2f 68 65 61 64 3e 0a 3c 62  itle>.</head>.<b
0040: 6f 64 79 20 62 67 63 6f 6c 6f 72 3d 22 77 68 69  ody bgcolor="whi
0050: 74 65 22 3e 0a 3c 70 3e 5b 20 3c 61 20 68 72 65  te">.<p>[ <a hre
0060: 66 3d 22 69 6e 64 65 78 2e 68 74 6d 6c 22 3e 49  f="index.html">I
0070: 6e 64 65 78 3c 2f 61 3e 20 5d 3c 2f 70 3e 0a 3c  ndex</a> ]</p>.<
0080: 68 72 3e 0a 3c 68 31 20 61 6c 69 67 6e 3d 22 63  hr>.<h1 align="c
0090: 65 6e 74 65 72 22 3e 54 68 65 20 46 6f 73 73 69  enter">The Fossi
00a0: 6c 20 53 79 6e 63 20 50 72 6f 74 6f 63 6f 6c 3c  l Sync Protocol<
00b0: 2f 68 31 3e 0a 0a 3c 70 3e 46 6f 73 73 69 6c 20  /h1>..<p>Fossil 
00c0: 73 75 70 70 6f 72 74 73 20 63 6f 6d 6d 61 6e 64  supports command
00d0: 73 20 3c 62 3e 70 75 73 68 3c 2f 62 3e 2c 20 3c  s <b>push</b>, <
00e0: 62 3e 70 75 6c 6c 3c 2f 62 3e 2c 20 61 6e 64 20  b>pull</b>, and 
00f0: 3c 62 3e 73 79 6e 63 3c 2f 62 3e 0a 66 6f 72 20  <b>sync</b>.for 
0100: 74 72 61 6e 73 66 65 72 72 69 6e 67 20 69 6e 66  transferring inf
0110: 6f 72 6d 61 74 69 6f 6e 20 66 72 6f 6d 20 6f 6e  ormation from on
0120: 65 20 72 65 70 6f 73 69 74 6f 72 79 20 74 6f 20  e repository to 
0130: 61 6e 6f 74 68 65 72 2e 20 20 54 68 65 0a 63 6f  another.  The.co
0140: 6d 6d 61 6e 64 20 69 73 20 72 75 6e 20 6f 6e 20  mmand is run on 
0150: 74 68 65 20 63 6c 69 65 6e 74 20 72 65 70 6f 73  the client repos
0160: 69 74 6f 72 79 2e 20 20 41 20 55 52 4c 20 66 6f  itory.  A URL fo
0170: 72 20 74 68 65 20 73 65 72 76 65 72 20 72 65 70  r the server rep
0180: 6f 73 69 74 6f 72 79 0a 69 73 20 73 70 65 63 69  ository.is speci
0190: 66 69 65 64 20 61 73 20 70 61 72 74 20 6f 66 20  fied as part of 
01a0: 74 68 65 20 63 6f 6d 6d 61 6e 64 2e 20 20 54 68  the command.  Th
01b0: 69 73 20 64 6f 63 75 6d 65 6e 74 20 64 65 73 63  is document desc
01c0: 72 69 62 65 73 20 77 68 61 74 20 68 61 70 70 65  ribes what happe
01d0: 6e 73 0a 62 65 68 69 6e 64 20 74 68 65 20 73 63  ns.behind the sc
01e0: 65 6e 65 73 20 69 6e 20 6f 72 64 65 72 20 74 6f  enes in order to
01f0: 20 73 79 6e 63 68 72 6f 6e 69 7a 65 20 74 68 65   synchronize the
0200: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20   information on 
0210: 74 68 65 20 74 77 6f 0a 72 65 70 6f 73 69 74 6f  the two.reposito
0220: 72 69 65 73 2e 3c 2f 70 3e 0a 0a 3c 68 32 3e 31  ries.</p>..<h2>1
0230: 2e 30 20 54 72 61 6e 73 70 6f 72 74 3c 2f 68 32  .0 Transport</h2
0240: 3e 0a 0a 3c 70 3e 41 6c 6c 20 63 6f 6d 6d 75 6e  >..<p>All commun
0250: 69 63 61 74 69 6f 6e 20 62 65 74 77 65 65 6e 20  ication between 
0260: 63 6c 69 65 6e 74 20 61 6e 64 20 73 65 72 76 65  client and serve
0270: 72 20 69 73 20 76 69 61 20 48 54 54 50 20 72 65  r is via HTTP re
0280: 71 75 65 73 74 73 2e 0a 54 68 65 20 73 65 72 76  quests..The serv
0290: 65 72 20 69 73 20 6c 69 73 74 65 6e 69 6e 67 20  er is listening 
02a0: 66 6f 72 20 69 6e 63 6f 6d 69 6e 67 20 48 54 54  for incoming HTT
02b0: 50 20 72 65 71 75 65 73 74 73 2e 20 20 54 68 65  P requests.  The
02c0: 20 63 6c 69 65 6e 74 0a 69 73 73 75 65 73 20 6f   client.issues o
02d0: 6e 65 20 6f 72 20 6d 6f 72 65 20 48 54 54 50 20  ne or more HTTP 
02e0: 72 65 71 75 65 73 74 73 20 61 6e 64 20 72 65 63  requests and rec
02f0: 65 69 76 65 73 20 72 65 70 6c 69 65 73 20 66 6f  eives replies fo
0300: 72 20 65 61 63 68 0a 72 65 71 75 65 73 74 2e 3c  r each.request.<
0310: 2f 70 3e 0a 0a 3c 70 3e 54 68 65 20 73 65 72 76  /p>..<p>The serv
0320: 65 72 20 6d 69 67 68 74 20 62 65 20 72 75 6e 6e  er might be runn
0330: 69 6e 67 20 61 73 20 61 6e 20 69 6e 64 65 70 65  ing as an indepe
0340: 6e 64 65 6e 74 20 73 65 72 76 65 72 0a 75 73 69  ndent server.usi
0350: 6e 67 20 74 68 65 20 3c 62 3e 73 65 72 76 65 72  ng the <b>server
0360: 3c 2f 62 3e 20 63 6f 6d 6d 61 6e 64 2c 20 6f 72  </b> command, or
0370: 20 69 74 20 6d 69 67 68 74 20 62 65 20 6c 61 75   it might be lau
0380: 6e 63 68 65 64 20 66 72 6f 6d 0a 69 6e 65 74 64  nched from.inetd
0390: 20 6f 72 20 78 69 6e 65 74 64 20 75 73 69 6e 67   or xinetd using
03a0: 20 74 68 65 20 3c 62 3e 68 74 74 70 3c 2f 62 3e   the <b>http</b>
03b0: 20 63 6f 6d 6d 61 6e 64 2e 20 20 4f 72 20 74 68   command.  Or th
03c0: 65 20 73 65 72 76 65 72 20 6d 69 67 68 74 0a 62  e server might.b
03d0: 65 20 6c 61 75 6e 63 68 65 64 20 66 72 6f 6d 20  e launched from 
03e0: 43 47 49 2e 20 20 54 68 65 20 64 65 74 61 69 6c  CGI.  The detail
03f0: 73 20 6f 66 20 68 6f 77 20 74 68 65 20 73 65 72  s of how the ser
0400: 76 65 72 20 69 73 20 63 6f 6e 66 69 67 75 72 65  ver is configure
0410: 64 0a 74 6f 20 22 6c 69 73 74 65 6e 22 20 66 6f  d.to "listen" fo
0420: 72 20 69 6e 63 6f 6d 69 6e 67 20 48 54 54 50 20  r incoming HTTP 
0430: 72 65 71 75 65 73 74 73 20 69 73 20 69 6d 6d 61  requests is imma
0440: 74 65 72 69 61 6c 2e 20 20 54 68 65 20 69 6d 70  terial.  The imp
0450: 6f 72 74 61 6e 74 0a 70 6f 69 6e 74 20 69 73 20  ortant.point is 
0460: 74 68 61 74 20 74 68 65 20 73 65 72 76 65 72 20  that the server 
0470: 69 73 20 6c 69 73 74 65 6e 69 6e 67 20 66 6f 72  is listening for
0480: 20 72 65 71 75 65 73 74 73 20 61 6e 64 20 74 68   requests and th
0490: 65 20 63 6c 69 65 6e 74 0a 69 73 20 74 68 65 20  e client.is the 
04a0: 69 73 73 75 65 72 20 6f 66 20 74 68 65 20 72 65  issuer of the re
04b0: 71 75 65 73 74 73 2e 3c 2f 70 3e 0a 0a 3c 70 3e  quests.</p>..<p>
04c0: 41 20 73 69 6e 67 6c 65 20 70 75 73 68 2c 20 70  A single push, p
04d0: 75 6c 6c 2c 20 6f 72 20 73 79 6e 63 20 6d 69 67  ull, or sync mig
04e0: 68 74 20 69 6e 76 6f 6c 76 65 20 6d 75 6c 74 69  ht involve multi
04f0: 70 6c 65 20 48 54 54 50 20 72 65 71 75 65 73 74  ple HTTP request
0500: 73 2e 0a 54 68 65 20 63 6c 69 65 6e 74 20 6d 61  s..The client ma
0510: 69 6e 74 61 69 6e 73 20 73 74 61 74 65 20 62 65  intains state be
0520: 74 77 65 65 6e 20 61 6c 6c 20 72 65 71 75 65 73  tween all reques
0530: 74 73 2e 20 20 42 75 74 20 6f 6e 20 74 68 65 20  ts.  But on the 
0540: 73 65 72 76 65 72 0a 73 69 64 65 2c 20 65 61 63  server.side, eac
0550: 68 20 72 65 71 75 65 73 74 20 69 73 20 69 6e 64  h request is ind
0560: 65 70 65 6e 64 65 6e 74 2e 20 20 54 68 65 20 73  ependent.  The s
0570: 65 72 76 65 72 20 64 6f 65 73 20 6e 6f 74 20 70  erver does not p
0580: 72 65 73 65 72 76 65 0a 61 6e 79 20 69 6e 66 6f  reserve.any info
0590: 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 20 74 68  rmation about th
05a0: 65 20 63 6c 69 65 6e 74 20 66 72 6f 6d 20 6f 6e  e client from on
05b0: 65 20 72 65 71 75 65 73 74 20 74 6f 20 74 68 65  e request to the
05c0: 20 6e 65 78 74 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e   next.</p>..<h3>
05d0: 31 2e 31 20 53 65 72 76 65 72 20 49 64 65 6e 74  1.1 Server Ident
05e0: 69 66 69 63 61 74 69 6f 6e 3c 2f 68 33 3e 0a 0a  ification</h3>..
05f0: 3c 70 3e 54 68 65 20 73 65 72 76 65 72 20 69 73  <p>The server is
0600: 20 69 64 65 6e 74 69 66 69 65 64 20 62 79 20 61   identified by a
0610: 20 55 52 4c 20 61 72 67 75 6d 65 6e 74 20 74 68   URL argument th
0620: 61 74 20 61 63 63 6f 6d 70 61 6e 69 65 73 20 74  at accompanies t
0630: 68 65 0a 70 75 73 68 2c 20 70 75 6c 6c 2c 20 6f  he.push, pull, o
0640: 72 20 73 79 6e 63 20 63 6f 6d 6d 61 6e 64 20 6f  r sync command o
0650: 6e 20 74 68 65 20 63 6c 69 65 6e 74 2e 20 20 28  n the client.  (
0660: 41 73 20 61 20 63 6f 6e 76 65 6e 69 65 6e 63 65  As a convenience
0670: 20 74 6f 0a 75 73 65 72 73 2c 20 74 68 65 20 55   to.users, the U
0680: 52 4c 20 63 61 6e 20 62 65 20 6f 6d 69 74 74 65  RL can be omitte
0690: 64 20 6f 6e 20 74 68 65 20 63 6c 69 65 6e 74 20  d on the client 
06a0: 63 6f 6d 6d 61 6e 64 20 61 6e 64 20 74 68 65 20  command and the 
06b0: 73 61 6d 65 20 55 52 4c 0a 66 72 6f 6d 20 74 68  same URL.from th
06c0: 65 20 6d 6f 73 74 20 72 65 63 65 6e 74 20 70 75  e most recent pu
06d0: 73 68 2c 20 70 75 6c 6c 2c 20 6f 72 20 73 79 6e  sh, pull, or syn
06e0: 63 20 77 69 6c 6c 20 62 65 20 72 65 75 73 65 64  c will be reused
06f0: 2e 20 20 54 68 69 73 20 73 61 76 65 73 0a 74 79  .  This saves.ty
0700: 70 69 6e 67 20 69 6e 20 74 68 65 20 63 6f 6d 6d  ping in the comm
0710: 6f 6e 20 63 61 73 65 20 77 68 65 72 65 20 74 68  on case where th
0720: 65 20 63 6c 69 65 6e 74 20 64 6f 65 73 20 6d 75  e client does mu
0730: 6c 74 69 70 6c 65 20 73 79 6e 63 73 20 74 6f 0a  ltiple syncs to.
0740: 74 68 65 20 73 61 6d 65 20 73 65 72 76 65 72 2e  the same server.
0750: 29 3c 2f 70 3e 0a 0a 3c 70 3e 54 68 65 20 63 6c  )</p>..<p>The cl
0760: 69 65 6e 74 20 6d 6f 64 69 66 69 65 73 20 74 68  ient modifies th
0770: 65 20 55 52 4c 20 62 79 20 61 70 70 65 6e 64 69  e URL by appendi
0780: 6e 67 20 74 68 65 20 6d 65 74 68 6f 64 20 6e 61  ng the method na
0790: 6d 65 20 22 3c 62 3e 2f 78 66 65 72 3c 2f 62 3e  me "<b>/xfer</b>
07a0: 22 0a 74 6f 20 74 68 65 20 65 6e 64 2e 20 20 46  ".to the end.  F
07b0: 6f 72 20 65 78 61 6d 70 6c 65 2c 20 69 66 20 74  or example, if t
07c0: 68 65 20 55 52 4c 20 73 70 65 63 69 66 69 65 64  he URL specified
07d0: 20 6f 6e 20 74 68 65 20 63 6c 69 65 6e 74 20 63   on the client c
07e0: 6f 6d 6d 61 6e 64 0a 6c 69 6e 65 20 69 73 3c 2f  ommand.line is</
07f0: 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e  p>..<blockquote>
0800: 0a 68 74 74 70 3a 2f 2f 66 6f 73 73 69 6c 2d 73  .http://fossil-s
0810: 63 6d 2e 68 77 61 63 69 2e 63 6f 6d 2f 66 6f 73  cm.hwaci.com/fos
0820: 73 69 6c 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65  sil.</blockquote
0830: 3e 0a 0a 3c 70 3e 54 68 65 6e 20 74 68 65 20 55  >..<p>Then the U
0840: 52 4c 20 74 68 61 74 20 69 73 20 72 65 61 6c 6c  RL that is reall
0850: 79 20 75 73 65 64 20 74 6f 20 64 6f 20 74 68 65  y used to do the
0860: 20 73 79 6e 63 68 72 6f 6e 69 7a 61 74 69 6f 6e   synchronization
0870: 20 77 69 6c 6c 0a 62 65 3a 3c 2f 70 3e 0a 0a 3c   will.be:</p>..<
0880: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 68 74 74 70  blockquote>.http
0890: 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 68 77  ://fossil-scm.hw
08a0: 61 63 69 2e 63 6f 6d 2f 66 6f 73 73 69 6c 2f 78  aci.com/fossil/x
08b0: 66 65 72 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65  fer.</blockquote
08c0: 3e 0a 0a 3c 68 33 3e 31 2e 32 20 48 54 54 50 20  >..<h3>1.2 HTTP 
08d0: 52 65 71 75 65 73 74 20 46 6f 72 6d 61 74 3c 2f  Request Format</
08e0: 68 33 3e 0a 0a 3c 70 3e 54 68 65 20 63 6c 69 65  h3>..<p>The clie
08f0: 6e 74 20 61 6c 77 61 79 73 20 73 65 6e 64 73 20  nt always sends 
0900: 61 20 50 4f 53 54 20 72 65 71 75 65 73 74 20 74  a POST request t
0910: 6f 20 74 68 65 20 73 65 72 76 65 72 2e 20 20 54  o the server.  T
0920: 68 65 0a 67 65 6e 65 72 61 6c 20 66 6f 72 6d 61  he.general forma
0930: 74 20 6f 66 20 74 68 65 20 50 4f 53 54 20 72 65  t of the POST re
0940: 71 75 65 73 74 20 69 73 20 61 73 20 66 6f 6c 6c  quest is as foll
0950: 6f 77 73 3a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b  ows:</p>..<block
0960: 71 75 6f 74 65 3e 3c 70 72 65 3e 0a 50 4f 53 54  quote><pre>.POST
0970: 20 2f 66 6f 73 73 69 6c 2f 78 66 65 72 20 48 54   /fossil/xfer HT
0980: 54 50 2f 31 2e 30 0a 48 6f 73 74 3a 20 66 6f 73  TP/1.0.Host: fos
0990: 73 69 6c 2d 73 63 6d 2e 68 77 61 63 69 2e 63 6f  sil-scm.hwaci.co
09a0: 6d 3a 38 30 0a 43 6f 6e 74 65 6e 74 2d 54 79 70  m:80.Content-Typ
09b0: 65 3a 20 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78  e: application/x
09c0: 2d 66 6f 73 73 69 6c 0a 43 6f 6e 74 65 6e 74 2d  -fossil.Content-
09d0: 4c 65 6e 67 74 68 3a 20 34 32 31 36 0a 0a 3c 69  Length: 4216..<i
09e0: 3e 63 6f 6e 74 65 6e 74 2e 2e 2e 3c 2f 69 3e 0a  >content...</i>.
09f0: 3c 2f 70 72 65 3e 3c 2f 62 6c 6f 63 6b 71 75 6f  </pre></blockquo
0a00: 74 65 3e 0a 0a 3c 70 3e 49 6e 20 74 68 65 20 65  te>..<p>In the e
0a10: 78 61 6d 70 6c 65 20 61 62 6f 76 65 2c 20 74 68  xample above, th
0a20: 65 20 70 61 74 68 6e 61 6d 65 20 67 69 76 65 6e  e pathname given
0a30: 20 61 66 74 65 72 20 74 68 65 20 50 4f 53 54 20   after the POST 
0a40: 6b 65 79 77 6f 72 64 0a 6f 6e 20 74 68 65 20 66  keyword.on the f
0a50: 69 72 73 74 20 6c 69 6e 65 20 69 73 20 61 20 63  irst line is a c
0a60: 6f 70 79 20 6f 66 20 74 68 65 20 55 52 4c 20 70  opy of the URL p
0a70: 61 74 68 6e 61 6d 65 2e 20 20 54 68 65 20 48 6f  athname.  The Ho
0a80: 73 74 3a 20 70 61 72 61 6d 65 74 65 72 0a 69 73  st: parameter.is
0a90: 20 61 6c 73 6f 20 74 61 6b 65 6e 20 66 72 6f 6d   also taken from
0aa0: 20 74 68 65 20 55 52 4c 2e 20 20 54 68 65 20 63   the URL.  The c
0ab0: 6f 6e 74 65 6e 74 20 74 79 70 65 20 69 73 20 61  ontent type is a
0ac0: 6c 77 61 79 73 20 65 69 74 68 65 72 0a 22 61 70  lways either."ap
0ad0: 70 6c 69 63 61 74 69 6f 6e 2f 78 2d 66 6f 73 73  plication/x-foss
0ae0: 69 6c 22 20 6f 72 20 22 61 70 70 6c 69 63 61 74  il" or "applicat
0af0: 69 6f 6e 2f 78 2d 66 6f 73 73 69 6c 2d 64 65 62  ion/x-fossil-deb
0b00: 75 67 22 2e 20 20 54 68 65 20 22 78 2d 66 6f 73  ug".  The "x-fos
0b10: 73 69 6c 22 0a 63 6f 6e 74 65 6e 74 20 74 79 70  sil".content typ
0b20: 65 20 69 73 20 74 68 65 20 64 65 66 61 75 6c 74  e is the default
0b30: 2e 20 20 54 68 65 20 6f 6e 6c 79 20 64 69 66 66  .  The only diff
0b40: 65 72 65 6e 63 65 20 69 73 20 74 68 61 74 20 22  erence is that "
0b50: 78 2d 66 6f 73 73 69 6c 22 0a 63 6f 6e 74 65 6e  x-fossil".conten
0b60: 74 20 69 73 20 63 6f 6d 70 72 65 73 73 65 64 20  t is compressed 
0b70: 75 73 69 6e 67 20 7a 6c 69 62 20 77 68 65 72 65  using zlib where
0b80: 61 73 20 22 78 2d 66 6f 73 73 69 6c 2d 64 65 62  as "x-fossil-deb
0b90: 75 67 22 20 69 73 20 73 65 6e 74 0a 75 6e 63 6f  ug" is sent.unco
0ba0: 6d 70 72 65 73 73 65 64 2e 3c 2f 70 3e 0a 0a 3c  mpressed.</p>..<
0bb0: 70 3e 41 20 74 79 70 69 63 61 6c 20 72 65 70 6c  p>A typical repl
0bc0: 79 20 66 72 6f 6d 20 74 68 65 20 73 65 72 76 65  y from the serve
0bd0: 72 20 6d 69 67 68 74 20 6c 6f 6f 6b 20 73 6f 6d  r might look som
0be0: 65 74 68 69 6e 67 20 6c 69 6b 65 20 74 68 69 73  ething like this
0bf0: 3a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f  :</p>..<blockquo
0c00: 74 65 3e 3c 70 72 65 3e 0a 48 54 54 50 2f 31 2e  te><pre>.HTTP/1.
0c10: 30 20 32 30 30 20 4f 4b 0a 44 61 74 65 3a 20 4d  0 200 OK.Date: M
0c20: 6f 6e 2c 20 31 30 20 53 65 70 20 32 30 30 37 20  on, 10 Sep 2007 
0c30: 31 32 3a 32 31 3a 30 31 20 47 4d 54 0a 43 6f 6e  12:21:01 GMT.Con
0c40: 6e 65 63 74 69 6f 6e 3a 20 63 6c 6f 73 65 0a 43  nection: close.C
0c50: 61 63 68 65 2d 63 6f 6e 74 72 6f 6c 3a 20 70 72  ache-control: pr
0c60: 69 76 61 74 65 0a 43 6f 6e 74 65 6e 74 2d 54 79  ivate.Content-Ty
0c70: 70 65 3a 20 61 70 70 6c 69 63 61 74 69 6f 6e 2f  pe: application/
0c80: 78 2d 66 6f 73 73 69 6c 3b 20 63 68 61 72 73 65  x-fossil; charse
0c90: 74 3d 55 53 2d 41 53 43 49 49 0a 43 6f 6e 74 65  t=US-ASCII.Conte
0ca0: 6e 74 2d 4c 65 6e 67 74 68 3a 20 32 36 35 0a 0a  nt-Length: 265..
0cb0: 3c 69 3e 63 6f 6e 74 65 6e 74 2e 2e 2e 3c 2f 69  <i>content...</i
0cc0: 3e 0a 3c 2f 70 72 65 3e 3c 2f 62 6c 6f 63 6b 71  >.</pre></blockq
0cd0: 75 6f 74 65 3e 0a 0a 3c 70 3e 54 68 65 20 63 6f  uote>..<p>The co
0ce0: 6e 74 65 6e 74 20 74 79 70 65 20 6f 66 20 74 68  ntent type of th
0cf0: 65 20 72 65 70 6c 79 20 69 73 20 61 6c 77 61 79  e reply is alway
0d00: 73 20 74 68 65 20 73 61 6d 65 20 61 73 20 74 68  s the same as th
0d10: 65 20 63 6f 6e 74 65 6e 74 20 74 79 70 65 0a 6f  e content type.o
0d20: 66 20 74 68 65 20 72 65 71 75 65 73 74 2e 3c 2f  f the request.</
0d30: 70 3e 0a 0a 3c 68 32 3e 32 2e 30 20 46 6f 73 73  p>..<h2>2.0 Foss
0d40: 69 6c 20 53 79 6e 63 68 72 6f 6e 69 7a 61 74 69  il Synchronizati
0d50: 6f 6e 20 43 6f 6e 74 65 6e 74 3c 2f 68 32 3e 0a  on Content</h2>.
0d60: 0a 3c 70 3e 41 20 73 79 6e 63 68 72 6f 6e 69 7a  .<p>A synchroniz
0d70: 61 74 69 6f 6e 20 72 65 71 75 65 73 74 20 62 65  ation request be
0d80: 74 77 65 65 6e 20 61 20 63 6c 69 65 6e 74 20 61  tween a client a
0d90: 6e 64 20 73 65 72 76 65 72 20 63 6f 6e 73 69 73  nd server consis
0da0: 74 73 20 6f 66 0a 6f 6e 65 20 6f 72 20 6d 6f 72  ts of.one or mor
0db0: 65 20 48 54 54 50 20 72 65 71 75 65 73 74 73 20  e HTTP requests 
0dc0: 61 73 20 64 65 73 63 72 69 62 65 64 20 69 6e 20  as described in 
0dd0: 74 68 65 20 70 72 65 76 69 6f 75 73 20 73 65 63  the previous sec
0de0: 74 69 6f 6e 2e 20 20 54 68 69 73 0a 73 65 63 74  tion.  This.sect
0df0: 69 6f 6e 20 64 65 74 61 69 6c 73 20 74 68 65 20  ion details the 
0e00: 22 78 2d 66 6f 73 73 69 6c 22 20 63 6f 6e 74 65  "x-fossil" conte
0e10: 6e 74 20 74 79 70 65 2e 3c 2f 70 3e 0a 0a 3c 68  nt type.</p>..<h
0e20: 33 3e 32 2e 31 20 4c 69 6e 65 2d 6f 72 69 65 6e  3>2.1 Line-orien
0e30: 74 65 64 20 46 6f 72 6d 61 74 3c 2f 68 33 3e 0a  ted Format</h3>.
0e40: 0a 3c 70 3e 54 68 65 20 78 2d 66 6f 73 73 69 6c  .<p>The x-fossil
0e50: 20 63 6f 6e 74 65 6e 74 20 74 79 70 65 20 63 6f   content type co
0e60: 6e 73 69 73 74 73 20 6f 66 20 7a 65 72 6f 20 6f  nsists of zero o
0e70: 72 20 6d 6f 72 65 20 22 63 61 72 64 73 22 2e 20  r more "cards". 
0e80: 20 43 61 72 64 73 0a 61 72 65 20 73 65 70 61 72   Cards.are separ
0e90: 61 74 65 20 62 79 20 74 68 65 20 6e 65 77 6c 69  ate by the newli
0ea0: 6e 65 20 63 68 61 72 61 63 74 65 72 20 28 22 5c  ne character ("\
0eb0: 6e 22 29 2e 20 20 4c 65 61 64 69 6e 67 20 61 6e  n").  Leading an
0ec0: 64 20 74 72 61 69 6c 69 6e 67 0a 77 68 69 74 65  d trailing.white
0ed0: 73 70 61 63 65 20 6f 6e 20 61 20 63 61 72 64 20  space on a card 
0ee0: 69 73 20 69 67 6e 6f 72 65 64 2e 20 20 42 6c 61  is ignored.  Bla
0ef0: 6e 6b 20 63 61 72 64 73 20 61 72 65 20 69 67 6e  nk cards are ign
0f00: 6f 72 65 64 2e 3c 2f 70 3e 0a 0a 3c 70 3e 45 61  ored.</p>..<p>Ea
0f10: 63 68 20 63 61 72 64 20 69 73 20 64 69 76 69 64  ch card is divid
0f20: 65 64 20 69 6e 74 6f 20 7a 65 72 6f 20 6f 72 20  ed into zero or 
0f30: 6d 6f 72 65 20 73 70 61 63 65 20 73 65 70 61 72  more space separ
0f40: 61 74 65 64 20 74 6f 6b 65 6e 73 2e 0a 54 68 65  ated tokens..The
0f50: 20 66 69 72 73 74 20 74 6f 6b 65 6e 20 6f 6e 20   first token on 
0f60: 65 61 63 68 20 63 61 72 64 20 69 73 20 74 68 65  each card is the
0f70: 20 6f 70 65 72 61 74 6f 72 2e 20 20 53 75 62 73   operator.  Subs
0f80: 65 71 75 65 6e 74 20 74 6f 6b 65 6e 73 0a 61 72  equent tokens.ar
0f90: 65 20 61 72 67 75 6d 65 6e 74 73 2e 20 20 54 68  e arguments.  Th
0fa0: 65 20 73 65 74 20 6f 66 20 6f 70 65 72 61 74 6f  e set of operato
0fb0: 72 73 20 75 6e 64 65 72 73 74 6f 6f 64 20 62 79  rs understood by
0fc0: 20 73 65 72 76 65 72 73 20 69 73 20 73 6c 69 67   servers is slig
0fd0: 68 74 6c 79 0a 64 69 66 66 65 72 65 6e 74 20 66  htly.different f
0fe0: 72 6f 6d 20 74 68 65 20 6f 70 65 72 61 74 6f 72  rom the operator
0ff0: 73 20 75 6e 64 65 72 73 74 6f 6f 64 20 62 79 20  s understood by 
1000: 63 6c 69 65 6e 74 73 2c 20 74 68 6f 75 67 68 20  clients, though 
1010: 74 68 65 20 74 77 6f 0a 61 72 65 20 76 65 72 79  the two.are very
1020: 20 73 69 6d 69 6c 61 72 2e 3c 2f 70 3e 0a 0a 3c   similar.</p>..<
1030: 68 33 3e 32 2e 32 20 4c 6f 67 69 6e 20 43 61 72  h3>2.2 Login Car
1040: 64 73 3c 2f 68 33 3e 0a 0a 3c 70 3e 45 76 65 72  ds</h3>..<p>Ever
1050: 79 20 6d 65 73 73 61 67 65 20 66 72 6f 6d 20 63  y message from c
1060: 6c 69 65 6e 74 20 74 6f 20 73 65 72 76 65 72 20  lient to server 
1070: 62 65 67 69 6e 73 20 77 69 74 68 20 6f 6e 65 20  begins with one 
1080: 6f 72 20 6d 6f 72 65 20 6c 6f 67 69 6e 0a 63 61  or more login.ca
1090: 72 64 73 2e 20 20 45 61 63 68 20 6c 6f 67 69 6e  rds.  Each login
10a0: 20 63 61 72 64 20 68 61 73 20 74 68 65 20 66 6f   card has the fo
10b0: 6c 6c 6f 77 69 6e 67 20 66 6f 72 6d 61 74 3a 3c  llowing format:<
10c0: 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65  /p>..<blockquote
10d0: 3e 0a 3c 62 3e 6c 6f 67 69 6e 3c 2f 62 3e 20 20  >.<b>login</b>  
10e0: 3c 69 3e 75 73 65 72 69 64 20 20 6e 6f 6e 63 65  <i>userid  nonce
10f0: 20 20 73 69 67 6e 61 74 75 72 65 3c 2f 69 3e 0a    signature</i>.
1100: 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c  </blockquote>..<
1110: 70 3e 54 68 65 20 75 73 65 72 69 64 20 69 73 20  p>The userid is 
1120: 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20  the name of the 
1130: 75 73 65 72 20 74 68 61 74 20 69 73 20 72 65 71  user that is req
1140: 75 65 73 74 69 6e 67 20 73 65 72 76 69 63 65 0a  uesting service.
1150: 66 72 6f 6d 20 74 68 65 20 73 65 72 76 65 72 2e  from the server.
1160: 20 20 54 68 65 20 6e 6f 6e 63 65 20 69 73 20 74    The nonce is t
1170: 68 65 20 53 48 41 31 20 68 61 73 68 20 6f 66 20  he SHA1 hash of 
1180: 74 68 65 20 72 65 6d 61 69 6e 64 65 72 20 6f 66  the remainder of
1190: 0a 74 68 65 20 6d 65 73 73 61 67 65 20 2d 20 61  .the message - a
11a0: 6c 6c 20 74 65 78 74 20 74 68 61 74 20 66 6f 6c  ll text that fol
11b0: 6c 6f 77 73 20 74 68 65 20 6e 65 77 6c 69 6e 65  lows the newline
11c0: 20 63 68 61 72 61 63 74 65 72 20 74 68 61 74 0a   character that.
11d0: 74 65 72 6d 69 6e 61 74 65 73 20 74 68 65 20 6c  terminates the l
11e0: 6f 67 69 6e 20 63 61 72 64 2e 20 20 54 68 65 20  ogin card.  The 
11f0: 73 69 67 6e 61 74 75 72 65 20 69 73 20 74 68 65  signature is the
1200: 20 53 48 41 31 20 68 61 73 68 20 6f 66 0a 74 68   SHA1 hash of.th
1210: 65 20 63 6f 6e 63 61 74 65 6e 61 74 69 6f 6e 20  e concatenation 
1220: 6f 66 20 74 68 65 20 6e 6f 6e 63 65 20 61 6e 64  of the nonce and
1230: 20 74 68 65 20 75 73 65 72 73 20 70 61 73 73 77   the users passw
1240: 6f 72 64 2e 3c 2f 70 3e 0a 0a 3c 70 3e 46 6f 72  ord.</p>..<p>For
1250: 20 65 61 63 68 20 6c 6f 67 69 6e 20 63 61 72 64   each login card
1260: 2c 20 74 68 65 20 73 65 72 76 65 72 20 6c 6f 6f  , the server loo
1270: 6b 73 20 75 70 20 74 68 65 20 75 73 65 72 20 61  ks up the user a
1280: 6e 64 20 76 65 72 69 66 69 65 73 0a 74 68 61 74  nd verifies.that
1290: 20 74 68 65 20 6e 6f 6e 63 65 20 6d 61 74 63 68   the nonce match
12a0: 65 73 20 74 68 65 20 53 48 41 31 20 68 61 73 68  es the SHA1 hash
12b0: 20 6f 66 20 74 68 65 20 72 65 6d 61 69 6e 64 65   of the remainde
12c0: 72 20 6f 66 20 74 68 65 0a 6d 65 73 73 61 67 65  r of the.message
12d0: 2e 20 20 49 74 20 74 68 65 6e 20 63 68 65 63 6b  .  It then check
12e0: 73 20 74 68 65 20 73 69 67 6e 61 74 75 72 65 20  s the signature 
12f0: 68 61 73 68 20 74 6f 20 6d 61 6b 65 20 73 75 72  hash to make sur
1300: 65 20 74 68 65 20 0a 73 69 67 6e 61 74 75 72 65  e the .signature
1310: 20 6d 61 74 63 68 65 73 2e 20 20 49 66 20 65 76   matches.  If ev
1320: 65 72 79 74 68 69 6e 67 0a 63 68 65 63 6b 73 20  erything.checks 
1330: 6f 75 74 2c 20 74 68 65 6e 20 74 68 65 20 63 6c  out, then the cl
1340: 69 65 6e 74 20 69 73 20 67 72 61 6e 74 65 64 20  ient is granted 
1350: 61 6c 6c 20 70 72 69 76 69 6c 65 67 65 73 20 6f  all privileges o
1360: 66 20 74 68 65 0a 73 70 65 63 69 66 69 65 64 20  f the.specified 
1370: 75 73 65 72 2e 3c 2f 70 3e 0a 0a 3c 70 3e 50 72  user.</p>..<p>Pr
1380: 69 76 69 6c 65 67 65 73 20 61 72 65 20 63 75 6d  ivileges are cum
1390: 75 6c 61 74 69 76 65 2e 20 20 54 68 65 72 65 20  ulative.  There 
13a0: 63 61 6e 20 62 65 20 6d 75 6c 74 69 70 6c 65 20  can be multiple 
13b0: 73 75 63 63 65 73 73 66 75 6c 0a 6c 6f 67 69 6e  successful.login
13c0: 20 63 61 72 64 73 2e 20 20 54 68 65 20 73 65 73   cards.  The ses
13d0: 73 69 6f 6e 20 70 72 69 76 69 6c 65 67 65 73 20  sion privileges 
13e0: 61 72 65 20 74 68 65 20 62 69 74 2d 77 69 73 65  are the bit-wise
13f0: 20 4f 52 20 6f 66 20 74 68 65 0a 70 72 69 76 69   OR of the.privi
1400: 6c 65 67 65 73 20 6f 66 20 65 61 63 68 20 69 6e  leges of each in
1410: 64 69 76 69 64 75 61 6c 20 6c 6f 67 69 6e 2e 3c  dividual login.<
1420: 2f 70 3e 0a 0a 3c 68 33 3e 32 2e 33 20 46 69 6c  /p>..<h3>2.3 Fil
1430: 65 20 43 61 72 64 73 3c 2f 68 33 3e 0a 0a 3c 70  e Cards</h3>..<p
1440: 3e 52 65 70 6f 73 69 74 6f 72 79 20 63 6f 6e 74  >Repository cont
1450: 65 6e 74 20 72 65 63 6f 72 64 73 20 6f 72 20 66  ent records or f
1460: 69 6c 65 73 20 61 72 65 20 74 72 61 6e 73 66 65  iles are transfe
1470: 72 72 65 64 20 75 73 69 6e 67 0a 61 20 22 66 69  rred using.a "fi
1480: 6c 65 22 20 63 61 72 64 2e 20 20 46 69 6c 65 20  le" card.  File 
1490: 63 61 72 64 73 20 63 6f 6d 65 20 69 6e 20 74 77  cards come in tw
14a0: 6f 20 64 69 66 66 65 72 65 6e 74 20 66 6f 72 6d  o different form
14b0: 61 74 73 20 64 65 70 65 6e 64 69 6e 67 0a 6f 6e  ats depending.on
14c0: 20 77 68 65 74 68 65 72 20 74 68 65 20 66 69 6c   whether the fil
14d0: 65 20 69 73 20 73 65 6e 74 20 64 69 72 65 63 74  e is sent direct
14e0: 6c 79 20 6f 72 20 61 73 20 61 20 64 65 6c 74 61  ly or as a delta
14f0: 20 66 72 6f 6d 20 73 6f 6d 65 0a 6f 74 68 65 72   from some.other
1500: 20 66 69 6c 65 2e 3c 2f 70 3e 0a 0a 3c 62 6c 6f   file.</p>..<blo
1510: 63 6b 71 75 6f 74 65 3e 0a 3c 62 3e 66 69 6c 65  ckquote>.<b>file
1520: 3c 2f 62 3e 20 3c 69 3e 75 75 69 64 20 73 69 7a  </b> <i>uuid siz
1530: 65 3c 2f 69 3e 20 3c 62 3e 5c 6e 3c 2f 62 3e 20  e</i> <b>\n</b> 
1540: 3c 69 3e 63 6f 6e 74 65 6e 74 3c 2f 69 3e 3c 62  <i>content</i><b
1550: 72 3e 0a 3c 62 3e 66 69 6c 65 3c 2f 62 3e 20 3c  r>.<b>file</b> <
1560: 69 3e 75 75 69 64 20 64 65 6c 74 61 2d 75 75 69  i>uuid delta-uui
1570: 64 20 73 69 7a 65 3c 2f 69 3e 20 3c 62 3e 5c 6e  d size</i> <b>\n
1580: 3c 2f 62 3e 20 3c 69 3e 63 6f 6e 74 65 6e 74 3c  </b> <i>content<
1590: 2f 69 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65  /i>.</blockquote
15a0: 3e 0a 0a 3c 70 3e 46 69 6c 65 20 63 61 72 64 73  >..<p>File cards
15b0: 20 61 72 65 20 64 69 66 66 65 72 65 6e 74 20 66   are different f
15c0: 72 6f 6d 20 61 6c 6c 20 6f 74 68 65 72 20 63 61  rom all other ca
15d0: 72 64 73 20 69 6e 20 74 68 61 74 20 74 68 65 79  rds in that they
15e0: 0a 66 6f 6c 6c 6f 77 65 64 20 62 79 20 69 6e 2d  .followed by in-
15f0: 6c 69 6e 65 20 22 70 61 79 6c 6f 61 64 22 20 64  line "payload" d
1600: 61 74 61 2e 20 20 54 68 65 20 63 6f 6e 74 65 6e  ata.  The conten
1610: 74 20 6f 66 20 74 68 65 20 66 69 6c 65 0a 6f 72  t of the file.or
1620: 20 74 68 65 20 66 69 6c 65 20 64 65 6c 74 61 20   the file delta 
1630: 63 6f 6e 73 69 73 74 73 20 6f 66 20 74 68 65 20  consists of the 
1640: 66 69 72 73 74 20 3c 69 3e 73 69 7a 65 3c 2f 69  first <i>size</i
1650: 3e 20 62 79 74 65 73 20 6f 66 20 74 68 65 0a 78  > bytes of the.x
1660: 2d 66 6f 73 73 69 6c 20 63 6f 6e 74 65 6e 74 20  -fossil content 
1670: 74 68 61 74 20 69 6d 6d 65 64 69 61 74 65 6c 79  that immediately
1680: 20 66 6f 6c 6c 6f 77 20 74 68 65 20 6e 65 77 6c   follow the newl
1690: 69 6e 65 20 74 68 61 74 0a 74 65 72 6d 69 6e 61  ine that.termina
16a0: 74 65 73 20 74 68 65 20 66 69 6c 65 20 63 61 72  tes the file car
16b0: 64 2e 20 20 4e 6f 20 6f 74 68 65 72 20 63 61 72  d.  No other car
16c0: 64 73 20 68 61 76 65 20 74 68 69 73 20 63 68 61  ds have this cha
16d0: 72 61 63 74 65 72 69 73 74 69 63 2e 0a 3c 2f 70  racteristic..</p
16e0: 3e 0a 0a 3c 70 3e 54 68 65 20 66 69 72 73 74 20  >..<p>The first 
16f0: 61 72 67 75 6d 65 6e 74 20 6f 66 20 61 20 66 69  argument of a fi
1700: 6c 65 20 63 61 72 64 20 69 73 20 74 68 65 20 55  le card is the U
1710: 55 49 44 20 6f 66 20 74 68 65 20 66 69 6c 65 20  UID of the file 
1720: 74 68 61 74 0a 69 73 20 62 65 69 6e 67 20 74 72  that.is being tr
1730: 61 6e 73 66 65 72 72 65 64 2e 20 20 54 68 65 20  ansferred.  The 
1740: 55 55 49 44 20 69 73 20 74 68 65 20 6c 6f 77 65  UUID is the lowe
1750: 72 2d 63 61 73 65 20 68 65 78 61 64 65 63 69 6d  r-case hexadecim
1760: 61 6c 0a 72 65 70 72 65 73 65 6e 74 61 74 69 6f  al.representatio
1770: 6e 20 6f 66 20 74 68 65 20 53 48 41 31 20 68 61  n of the SHA1 ha
1780: 73 68 20 6f 66 20 74 68 65 20 65 6e 74 69 72 65  sh of the entire
1790: 20 66 69 6c 65 20 63 6f 6e 74 65 6e 74 2e 0a 54   file content..T
17a0: 68 65 20 6c 61 73 74 20 61 72 67 75 6d 65 6e 74  he last argument
17b0: 20 6f 66 20 74 68 65 20 66 69 6c 65 20 63 61 72   of the file car
17c0: 64 20 69 73 20 74 68 65 20 6e 75 6d 62 65 72 20  d is the number 
17d0: 6f 66 20 62 79 74 65 73 20 6f 66 0a 70 61 79 6c  of bytes of.payl
17e0: 6f 61 64 20 74 68 61 74 20 69 6d 6d 65 64 69 61  oad that immedia
17f0: 74 65 6c 79 20 66 6f 6c 6c 6f 77 20 74 68 65 20  tely follow the 
1800: 66 69 6c 65 20 63 61 72 64 2e 20 20 49 66 20 74  file card.  If t
1810: 68 65 20 66 69 6c 65 0a 63 61 72 64 20 68 61 73  he file.card has
1820: 20 6f 6e 6c 79 20 74 77 6f 20 61 72 67 75 6d 65   only two argume
1830: 6e 74 73 2c 20 74 68 61 74 20 6d 65 61 6e 73 20  nts, that means 
1840: 74 68 65 20 70 61 79 6c 6f 61 64 20 69 73 20 74  the payload is t
1850: 68 65 0a 63 6f 6d 70 6c 65 74 65 20 63 6f 6e 74  he.complete cont
1860: 65 6e 74 20 6f 66 20 74 68 65 20 66 69 6c 65 2e  ent of the file.
1870: 20 20 49 66 20 74 68 65 20 66 69 6c 65 20 63 61    If the file ca
1880: 72 64 20 68 61 73 20 74 68 72 65 65 0a 61 72 67  rd has three.arg
1890: 75 6d 65 6e 74 73 2c 20 74 68 65 6e 20 74 68 65  uments, then the
18a0: 20 70 61 79 6c 6f 61 64 20 69 73 20 61 20 64 65   payload is a de
18b0: 6c 74 61 20 61 6e 64 20 73 65 63 6f 6e 64 20 61  lta and second a
18c0: 72 67 75 6d 65 6e 74 20 69 73 0a 74 68 65 20 55  rgument is.the U
18d0: 55 49 44 20 6f 66 20 61 6e 6f 74 68 65 72 20 66  UID of another f
18e0: 69 6c 65 20 74 68 61 74 20 69 73 20 74 68 65 20  ile that is the 
18f0: 73 6f 75 72 63 65 20 6f 66 20 74 68 65 20 64 65  source of the de
1900: 6c 74 61 2e 3c 2f 70 3e 0a 0a 3c 70 3e 46 69 6c  lta.</p>..<p>Fil
1910: 65 20 63 61 72 64 73 20 61 72 65 20 73 65 6e 74  e cards are sent
1920: 20 69 6e 20 62 6f 74 68 20 64 69 72 65 63 74 69   in both directi
1930: 6f 6e 73 3a 20 63 6c 69 65 6e 74 20 74 6f 20 73  ons: client to s
1940: 65 72 76 65 72 20 61 6e 64 0a 73 65 72 76 65 72  erver and.server
1950: 20 74 6f 20 63 6c 69 65 6e 74 2e 20 20 41 20 64   to client.  A d
1960: 65 6c 74 61 20 6d 69 67 68 74 20 62 65 20 73 65  elta might be se
1970: 6e 74 20 62 65 66 6f 72 65 20 74 68 65 20 73 6f  nt before the so
1980: 75 72 63 65 20 6f 66 0a 74 68 65 20 64 65 6c 74  urce of.the delt
1990: 61 2c 20 73 6f 20 62 6f 74 68 20 63 6c 69 65 6e  a, so both clien
19a0: 74 20 61 6e 64 20 73 65 72 76 65 72 20 73 68 6f  t and server sho
19b0: 75 6c 64 20 72 65 6d 65 6d 62 65 72 20 64 65 6c  uld remember del
19c0: 74 61 73 0a 61 6e 64 20 62 65 20 61 62 6c 65 20  tas.and be able 
19d0: 74 6f 20 61 70 70 6c 79 20 74 68 65 6d 20 77 68  to apply them wh
19e0: 65 6e 20 74 68 65 69 72 20 73 6f 75 72 63 65 20  en their source 
19f0: 61 72 72 69 76 65 73 2e 3c 2f 70 3e 0a 0a 3c 68  arrives.</p>..<h
1a00: 33 3e 32 2e 34 20 50 75 73 68 20 61 6e 64 20 50  3>2.4 Push and P
1a10: 75 6c 6c 20 43 61 72 64 73 3c 2f 68 33 3e 0a 0a  ull Cards</h3>..
1a20: 3c 70 3e 41 6d 6f 6e 67 20 6f 66 20 74 68 65 20  <p>Among of the 
1a30: 66 69 72 73 74 20 63 61 72 64 73 20 69 6e 20 61  first cards in a
1a40: 20 63 6c 69 65 6e 74 2d 74 6f 2d 73 65 72 76 65   client-to-serve
1a50: 72 20 6d 65 73 73 61 67 65 20 61 72 65 0a 74 68  r message are.th
1a60: 65 20 70 75 73 68 20 61 6e 64 20 70 75 6c 6c 20  e push and pull 
1a70: 63 61 72 64 73 2e 20 20 54 68 65 20 70 75 73 68  cards.  The push
1a80: 20 63 61 72 64 20 74 65 6c 6c 20 74 68 65 20 73   card tell the s
1a90: 65 72 76 65 72 20 74 68 61 74 0a 74 68 65 20 63  erver that.the c
1aa0: 6c 69 65 6e 74 20 69 73 20 70 75 73 68 69 6e 67  lient is pushing
1ab0: 20 63 6f 6e 74 65 6e 74 2e 20 20 54 68 65 20 70   content.  The p
1ac0: 75 6c 6c 20 63 61 72 64 20 74 65 6c 6c 20 74 68  ull card tell th
1ad0: 65 20 73 65 72 76 65 72 0a 74 68 61 74 20 74 68  e server.that th
1ae0: 65 20 63 6c 69 65 6e 74 20 77 61 6e 74 73 20 74  e client wants t
1af0: 6f 20 70 75 6c 6c 20 63 6f 6e 74 65 6e 74 2e 20  o pull content. 
1b00: 20 49 6e 20 74 68 65 20 65 76 65 6e 74 20 6f 66   In the event of
1b10: 20 61 20 73 79 6e 63 2c 0a 62 6f 74 68 20 63 61   a sync,.both ca
1b20: 72 64 73 20 61 72 65 20 73 65 6e 74 2e 20 20 54  rds are sent.  T
1b30: 68 65 20 66 6f 72 6d 61 74 20 69 73 20 61 73 20  he format is as 
1b40: 66 6f 6c 6c 6f 77 73 3a 3c 2f 70 3e 0a 0a 3c 62  follows:</p>..<b
1b50: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62 3e 70 75  lockquote>.<b>pu
1b60: 73 68 3c 2f 62 3e 20 3c 69 3e 73 65 72 76 65 72  sh</b> <i>server
1b70: 63 6f 64 65 20 70 72 6f 6a 65 63 74 63 6f 64 65  code projectcode
1b80: 3c 2f 69 3e 3c 62 72 3e 0a 3c 62 3e 70 75 6c 6c  </i><br>.<b>pull
1b90: 3c 2f 62 3e 20 3c 69 3e 73 65 72 76 65 72 63 6f  </b> <i>serverco
1ba0: 64 65 20 70 72 6f 6a 65 63 74 63 6f 64 65 3c 2f  de projectcode</
1bb0: 69 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e  i>.</blockquote>
1bc0: 0a 0a 3c 70 3e 54 68 65 20 3c 69 3e 73 65 72 76  ..<p>The <i>serv
1bd0: 65 72 63 6f 64 65 3c 2f 69 3e 20 61 72 67 75 6d  ercode</i> argum
1be0: 65 6e 74 20 69 73 20 74 68 65 20 72 65 70 6f 73  ent is the repos
1bf0: 69 74 6f 72 79 20 49 44 20 66 6f 72 20 74 68 65  itory ID for the
1c00: 0a 63 6c 69 65 6e 74 2e 20 20 54 68 65 20 73 65  .client.  The se
1c10: 72 76 65 72 20 77 69 6c 6c 20 6f 6e 6c 79 20 61  rver will only a
1c20: 6c 6c 6f 77 20 74 68 65 20 74 72 61 6e 73 61 63  llow the transac
1c30: 74 69 6f 6e 20 74 6f 20 70 72 6f 63 65 65 64 0a  tion to proceed.
1c40: 69 66 20 74 68 65 20 73 65 72 76 65 72 63 6f 64  if the servercod
1c50: 65 20 69 73 20 64 69 66 66 65 72 65 6e 74 20 66  e is different f
1c60: 72 6f 6d 20 69 74 73 20 6f 77 6e 20 73 65 72 76  rom its own serv
1c70: 65 72 63 6f 64 65 2e 20 20 54 68 69 73 0a 70 72  ercode.  This.pr
1c80: 65 76 65 6e 74 73 20 61 20 73 79 6e 63 2d 6c 6f  events a sync-lo
1c90: 6f 70 2e 20 20 54 68 65 20 3c 69 3e 70 72 6f 6a  op.  The <i>proj
1ca0: 65 63 74 63 6f 64 65 3c 2f 69 3e 20 69 73 20 74  ectcode</i> is t
1cb0: 68 65 20 69 64 65 6e 74 69 66 69 65 72 0a 6f 66  he identifier.of
1cc0: 20 74 68 65 20 73 6f 66 74 77 61 72 65 20 70 72   the software pr
1cd0: 6f 6a 65 63 74 20 74 68 61 74 20 74 68 65 20 63  oject that the c
1ce0: 6c 69 65 6e 74 20 72 65 70 6f 73 69 74 6f 72 79  lient repository
1cf0: 20 63 6f 6e 74 61 69 6e 73 2e 0a 54 68 65 20 70   contains..The p
1d00: 72 6f 6a 65 63 74 63 6f 64 65 20 66 6f 72 20 74  rojectcode for t
1d10: 68 65 20 63 6c 69 65 6e 74 20 61 6e 64 20 73 65  he client and se
1d20: 72 76 65 72 20 6d 75 73 74 20 6d 61 74 63 68 20  rver must match 
1d30: 69 6e 20 6f 72 64 65 72 0a 66 6f 72 20 74 68 65  in order.for the
1d40: 20 74 72 61 6e 73 61 63 74 69 6f 6e 20 74 6f 20   transaction to 
1d50: 70 72 6f 63 65 65 64 2e 3c 2f 70 3e 0a 0a 3c 70  proceed.</p>..<p
1d60: 3e 54 68 65 20 73 65 72 76 65 72 20 77 69 6c 6c  >The server will
1d70: 20 61 6c 73 6f 20 73 65 6e 64 20 61 20 70 75 73   also send a pus
1d80: 68 20 63 61 72 64 20 62 61 63 6b 20 74 6f 20 74  h card back to t
1d90: 68 65 20 63 6c 69 65 6e 74 0a 64 75 72 69 6e 67  he client.during
1da0: 20 61 20 63 6c 6f 6e 65 2e 20 20 54 68 69 73 20   a clone.  This 
1db0: 69 73 20 68 6f 77 20 74 68 65 20 63 6c 69 65 6e  is how the clien
1dc0: 74 20 64 65 74 65 72 6d 69 6e 65 73 20 77 68 61  t determines wha
1dd0: 74 20 70 72 6f 6a 65 63 74 0a 63 6f 64 65 20 74  t project.code t
1de0: 6f 20 70 75 74 20 69 6e 20 74 68 65 20 6e 65 77  o put in the new
1df0: 20 72 65 70 6f 73 69 74 6f 72 79 20 69 74 20 69   repository it i
1e00: 73 20 63 6f 6e 73 74 72 75 63 74 69 6e 67 2e 3c  s constructing.<
1e10: 2f 70 3e 0a 0a 3c 68 33 3e 32 2e 35 20 43 6c 6f  /p>..<h3>2.5 Clo
1e20: 6e 65 20 43 61 72 64 73 3c 2f 68 33 3e 0a 0a 3c  ne Cards</h3>..<
1e30: 70 3e 41 20 63 6c 6f 6e 65 20 63 61 72 64 20 77  p>A clone card w
1e40: 6f 72 6b 73 20 6c 69 6b 65 20 61 20 70 75 6c 6c  orks like a pull
1e50: 20 63 61 72 64 20 69 6e 20 74 68 61 74 20 69 74   card in that it
1e60: 20 69 73 20 73 65 6e 74 20 66 72 6f 6d 0a 63 6c   is sent from.cl
1e70: 69 65 6e 74 20 74 6f 20 73 65 72 76 65 72 20 69  ient to server i
1e80: 6e 20 6f 72 64 65 72 20 74 6f 20 74 65 6c 6c 20  n order to tell 
1e90: 74 68 65 20 73 65 72 76 65 72 20 74 68 61 74 20  the server that 
1ea0: 74 68 65 20 63 6c 69 65 6e 74 0a 77 61 6e 74 73  the client.wants
1eb0: 20 74 6f 20 70 75 6c 6c 20 63 6f 6e 74 65 6e 74   to pull content
1ec0: 2e 20 20 42 75 74 20 75 6e 6c 69 6b 65 20 74 68  .  But unlike th
1ed0: 65 20 70 75 6c 6c 20 63 61 72 64 2c 20 74 68 65  e pull card, the
1ee0: 20 63 6c 6f 6e 65 0a 63 61 72 64 20 68 61 73 20   clone.card has 
1ef0: 6e 6f 20 61 72 67 75 6d 65 6e 74 73 2e 3c 2f 70  no arguments.</p
1f00: 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a  >..<blockquote>.
1f10: 3c 62 3e 63 6c 6f 6e 65 3c 2f 62 3e 0a 3c 2f 62  <b>clone</b>.</b
1f20: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e 49  lockquote>..<p>I
1f30: 6e 20 72 65 73 70 6f 6e 73 65 20 74 6f 20 61 20  n response to a 
1f40: 63 6c 6f 6e 65 20 6d 65 73 73 61 67 65 2c 20 74  clone message, t
1f50: 68 65 20 73 65 72 76 65 72 20 61 6c 73 6f 20 73  he server also s
1f60: 65 6e 64 73 20 74 68 65 20 63 6c 69 65 6e 74 0a  ends the client.
1f70: 61 20 70 75 73 68 20 6d 65 73 73 61 67 65 20 73  a push message s
1f80: 6f 20 74 68 61 74 20 74 68 65 20 63 6c 69 65 6e  o that the clien
1f90: 74 20 63 61 6e 20 64 69 73 63 6f 76 65 72 20 74  t can discover t
1fa0: 68 65 20 70 72 6f 6a 65 63 74 63 6f 64 65 20 66  he projectcode f
1fb0: 6f 72 0a 74 68 69 73 20 70 72 6f 6a 65 63 74 2e  or.this project.
1fc0: 3c 2f 70 3e 0a 0a 3c 68 33 3e 32 2e 36 20 49 67  </p>..<h3>2.6 Ig
1fd0: 6f 74 20 43 61 72 64 73 3c 2f 68 33 3e 0a 0a 3c  ot Cards</h3>..<
1fe0: 70 3e 41 6e 20 69 67 6f 74 20 63 61 72 64 20 63  p>An igot card c
1ff0: 61 6e 20 62 65 20 73 65 6e 74 20 66 72 6f 6d 20  an be sent from 
2000: 65 69 74 68 65 72 20 63 6c 69 65 6e 74 20 74 6f  either client to
2010: 20 73 65 72 76 65 72 20 6f 72 20 66 72 6f 6d 0a   server or from.
2020: 73 65 72 76 65 72 20 74 6f 20 63 6c 69 65 6e 74  server to client
2030: 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 69 6e 64   in order to ind
2040: 69 63 61 74 65 20 74 68 61 74 20 74 68 65 20 73  icate that the s
2050: 65 6e 64 65 72 20 68 6f 6c 64 73 20 61 20 63 6f  ender holds a co
2060: 70 79 0a 6f 66 20 61 20 70 61 72 74 69 63 75 6c  py.of a particul
2070: 61 72 20 66 69 6c 65 2e 20 20 54 68 65 20 66 6f  ar file.  The fo
2080: 72 6d 61 74 20 69 73 3a 3c 2f 70 3e 0a 0a 3c 62  rmat is:</p>..<b
2090: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62 3e 69 67  lockquote>.<b>ig
20a0: 6f 74 3c 2f 62 3e 20 3c 69 3e 75 75 69 64 3c 2f  ot</b> <i>uuid</
20b0: 69 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e  i>.</blockquote>
20c0: 0a 0a 3c 70 3e 54 68 65 20 61 72 67 75 6d 65 6e  ..<p>The argumen
20d0: 74 20 6f 66 20 74 68 65 20 69 67 6f 74 20 63 61  t of the igot ca
20e0: 72 64 20 69 73 20 74 68 65 20 55 55 49 44 20 6f  rd is the UUID o
20f0: 66 20 74 68 65 20 66 69 6c 65 20 74 68 61 74 0a  f the file that.
2100: 74 68 65 20 73 65 6e 64 65 72 20 70 6f 73 73 65  the sender posse
2110: 73 73 65 73 2e 0a 54 68 65 20 72 65 63 65 69 76  sses..The receiv
2120: 65 72 20 6f 66 20 61 6e 20 69 67 6f 74 20 63 61  er of an igot ca
2130: 72 64 20 77 69 6c 6c 20 74 79 70 69 63 61 6c 6c  rd will typicall
2140: 79 20 63 68 65 63 6b 20 74 6f 20 73 65 65 20 69  y check to see i
2150: 66 0a 69 74 20 61 6c 73 6f 20 68 6f 6c 64 73 20  f.it also holds 
2160: 74 68 65 20 73 61 6d 65 20 66 69 6c 65 20 61 6e  the same file an
2170: 64 20 69 66 20 6e 6f 74 20 69 74 20 77 69 6c 6c  d if not it will
2180: 20 72 65 71 75 65 73 74 20 74 68 65 20 66 69 6c   request the fil
2190: 65 0a 75 73 69 6e 67 20 61 20 67 69 6d 6d 65 20  e.using a gimme 
21a0: 63 61 72 64 20 69 6e 20 65 69 74 68 65 72 20 74  card in either t
21b0: 68 65 20 72 65 70 6c 79 20 6f 72 20 69 6e 20 74  he reply or in t
21c0: 68 65 20 6e 65 78 74 20 6d 65 73 73 61 67 65 2e  he next message.
21d0: 3c 2f 70 3e 0a 0a 3c 68 33 3e 32 2e 37 20 47 69  </p>..<h3>2.7 Gi
21e0: 6d 6d 65 20 43 61 72 64 73 3c 2f 68 33 3e 0a 0a  mme Cards</h3>..
21f0: 3c 70 3e 41 20 67 69 6d 6d 65 20 63 61 72 64 20  <p>A gimme card 
2200: 69 73 20 73 65 6e 74 20 66 72 6f 6d 20 65 69 74  is sent from eit
2210: 68 65 72 20 63 6c 69 65 6e 74 20 74 6f 20 73 65  her client to se
2220: 72 76 65 72 20 6f 72 20 66 72 6f 6d 20 73 65 72  rver or from ser
2230: 76 65 72 0a 74 6f 20 63 6c 69 65 6e 74 2e 20 20  ver.to client.  
2240: 54 68 65 20 67 69 6d 6d 65 20 63 61 72 64 20 61  The gimme card a
2250: 73 6b 73 20 74 68 65 20 72 65 63 65 69 76 65 72  sks the receiver
2260: 20 74 6f 20 73 65 6e 64 20 61 20 70 61 72 74 69   to send a parti
2270: 63 75 6c 61 72 0a 66 69 6c 65 20 62 61 63 6b 20  cular.file back 
2280: 74 6f 20 74 68 65 20 73 65 6e 64 65 72 2e 20 20  to the sender.  
2290: 54 68 65 20 66 6f 72 6d 61 74 20 6f 66 20 61 20  The format of a 
22a0: 67 69 6d 6d 65 20 63 61 72 64 20 69 73 20 74 68  gimme card is th
22b0: 69 73 3a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71  is:</p>..<blockq
22c0: 75 6f 74 65 3e 0a 3c 62 3e 67 69 6d 6d 65 3c 2f  uote>.<b>gimme</
22d0: 62 3e 20 3c 69 3e 75 75 69 64 3c 2f 69 3e 0a 3c  b> <i>uuid</i>.<
22e0: 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70  /blockquote>..<p
22f0: 3e 54 68 65 20 61 72 67 75 6d 65 6e 74 20 74 6f  >The argument to
2300: 20 74 68 65 20 67 69 6d 6d 65 20 63 61 72 64 20   the gimme card 
2310: 69 73 20 74 68 65 20 55 55 49 44 20 6f 66 20 74  is the UUID of t
2320: 68 65 20 66 69 6c 65 20 74 68 61 74 0a 74 68 65  he file that.the
2330: 20 73 65 6e 64 65 72 20 77 61 6e 74 73 2e 20 20   sender wants.  
2340: 54 68 65 20 72 65 63 65 69 76 65 72 20 77 69 6c  The receiver wil
2350: 6c 20 74 79 70 69 63 61 6c 6c 79 20 72 65 73 70  l typically resp
2360: 6f 6e 64 20 74 6f 20 61 0a 67 69 6d 6d 65 20 63  ond to a.gimme c
2370: 61 72 64 20 62 79 20 73 65 6e 64 69 6e 67 20 61  ard by sending a
2380: 20 66 69 6c 65 20 63 61 72 64 20 69 6e 20 69 74   file card in it
2390: 73 20 72 65 70 6c 79 20 6f 72 20 69 6e 20 74 68  s reply or in th
23a0: 65 20 6e 65 78 74 0a 6d 65 73 73 61 67 65 2e 3c  e next.message.<
23b0: 2f 70 3e 0a 0a 3c 68 33 3e 32 2e 38 20 43 6f 6f  /p>..<h3>2.8 Coo
23c0: 6b 69 65 20 43 61 72 64 73 3c 2f 68 33 3e 0a 0a  kie Cards</h3>..
23d0: 3c 70 3e 41 20 63 6f 6f 6b 69 65 20 63 61 72 64  <p>A cookie card
23e0: 20 63 61 6e 20 62 65 20 75 73 65 64 20 62 79 20   can be used by 
23f0: 61 20 73 65 72 76 65 72 20 74 6f 20 72 65 63 6f  a server to reco
2400: 72 64 20 61 20 73 6d 61 6c 6c 20 61 6d 6f 75 6e  rd a small amoun
2410: 74 0a 6f 66 20 73 74 61 74 65 20 69 6e 66 6f 72  t.of state infor
2420: 6d 61 74 69 6f 6e 20 6f 6e 20 61 20 63 6c 69 65  mation on a clie
2430: 6e 74 2e 20 20 54 68 65 20 73 65 72 76 65 72 20  nt.  The server 
2440: 73 65 6e 64 73 20 61 20 63 6f 6f 6b 69 65 20 74  sends a cookie t
2450: 6f 20 74 68 65 0a 63 6c 69 65 6e 74 2e 20 20 54  o the.client.  T
2460: 68 65 20 63 6c 69 65 6e 74 20 73 65 6e 64 73 20  he client sends 
2470: 74 68 65 20 73 61 6d 65 20 63 6f 6f 6b 69 65 20  the same cookie 
2480: 62 61 63 6b 20 74 6f 20 74 68 65 20 73 65 72 76  back to the serv
2490: 65 72 20 6f 6e 0a 69 74 73 20 6e 65 78 74 20 72  er on.its next r
24a0: 65 71 75 65 73 74 2e 20 20 54 68 65 20 63 6f 6f  equest.  The coo
24b0: 6b 69 65 20 63 61 72 64 20 68 61 73 20 61 20 73  kie card has a s
24c0: 69 6e 67 6c 65 20 61 72 67 75 6d 65 6e 74 20 77  ingle argument w
24d0: 68 69 63 68 0a 69 73 20 69 74 73 20 70 61 79 6c  hich.is its payl
24e0: 6f 61 64 2e 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b  oad.</p>..<block
24f0: 71 75 6f 74 65 3e 0a 3c 62 3e 63 6f 6f 6b 69 65  quote>.<b>cookie
2500: 3c 2f 62 3e 20 3c 69 3e 70 61 79 6c 6f 61 64 3c  </b> <i>payload<
2510: 2f 69 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65  /i>.</blockquote
2520: 3e 0a 0a 3c 70 3e 54 68 65 20 63 6c 69 65 6e 74  >..<p>The client
2530: 20 69 73 20 6e 6f 74 20 72 65 71 75 69 72 65 64   is not required
2540: 20 74 6f 20 72 65 74 75 72 6e 20 74 68 65 20 63   to return the c
2550: 6f 6f 6b 69 65 20 74 6f 20 74 68 65 20 73 65 72  ookie to the ser
2560: 76 65 72 20 6f 6e 0a 69 74 73 20 6e 65 78 74 20  ver on.its next 
2570: 72 65 71 75 65 73 74 2e 20 20 4f 72 20 74 68 65  request.  Or the
2580: 20 63 6c 69 65 6e 74 20 6d 69 67 68 74 20 73 65   client might se
2590: 6e 64 20 61 20 63 6f 6f 6b 69 65 20 66 72 6f 6d  nd a cookie from
25a0: 20 61 20 64 69 66 66 65 72 65 6e 74 0a 73 65 72   a different.ser
25b0: 76 65 72 20 6f 6e 20 74 68 65 20 6e 65 78 74 20  ver on the next 
25c0: 72 65 71 75 65 73 74 2e 20 20 53 6f 20 74 68 65  request.  So the
25d0: 20 73 65 72 76 65 72 20 6d 75 73 74 20 6e 6f 74   server must not
25e0: 20 64 65 70 65 6e 64 20 6f 6e 20 74 68 65 0a 63   depend on the.c
25f0: 6f 6f 6b 69 65 20 61 6e 64 20 74 68 65 20 73 65  ookie and the se
2600: 72 76 65 72 20 6d 75 73 74 20 73 74 72 75 63 74  rver must struct
2610: 75 72 65 20 74 68 65 20 63 6f 6f 6b 69 65 20 70  ure the cookie p
2620: 61 79 6c 6f 61 64 20 69 6e 20 73 75 63 68 0a 61  ayload in such.a
2630: 20 77 61 79 20 74 68 61 74 20 69 74 20 63 61 6e   way that it can
2640: 20 74 65 6c 6c 20 69 66 20 74 68 65 20 63 6f 6f   tell if the coo
2650: 6b 69 65 20 69 74 20 73 65 65 73 20 69 73 20 69  kie it sees is i
2660: 74 73 20 6f 77 6e 20 63 6f 6f 6b 69 65 20 6f 72  ts own cookie or
2670: 0a 61 20 63 6f 6f 6b 69 65 20 66 72 6f 6d 20 61  .a cookie from a
2680: 6e 6f 74 68 65 72 20 73 65 72 76 65 72 2e 20 20  nother server.  
2690: 28 54 79 70 69 63 61 6c 6c 79 20 74 68 65 20 73  (Typically the s
26a0: 65 72 76 65 72 20 77 69 6c 6c 20 65 6d 62 65 64  erver will embed
26b0: 0a 69 74 73 20 73 65 72 76 65 72 63 6f 64 65 20  .its servercode 
26c0: 61 73 20 70 61 72 74 20 6f 66 20 74 68 65 20 63  as part of the c
26d0: 6f 6f 6b 69 65 2e 29 3c 2f 70 3e 0a 0a 3c 68 33  ookie.)</p>..<h3
26e0: 3e 32 2e 39 20 45 72 72 6f 72 20 43 61 72 64 73  >2.9 Error Cards
26f0: 3c 2f 68 33 3e 0a 0a 3c 70 3e 49 66 20 74 68 65  </h3>..<p>If the
2700: 20 73 65 72 76 65 72 20 64 69 73 63 6f 76 65 72   server discover
2710: 73 20 61 6e 79 74 68 69 6e 67 20 77 72 6f 6e 67  s anything wrong
2720: 20 77 69 74 68 20 61 20 72 65 71 75 65 73 74 2c   with a request,
2730: 20 69 74 20 67 65 6e 65 72 61 74 65 73 0a 61 6e   it generates.an
2740: 20 65 72 72 6f 72 20 63 61 72 64 20 69 6e 20 69   error card in i
2750: 74 73 20 72 65 70 6c 79 2e 20 20 57 68 65 6e 20  ts reply.  When 
2760: 74 68 65 20 63 6c 69 65 6e 74 20 73 65 65 73 20  the client sees 
2770: 74 68 65 20 65 72 72 6f 72 20 63 61 72 64 2c 0a  the error card,.
2780: 69 74 20 64 69 73 70 6c 61 79 73 20 61 6e 20 65  it displays an e
2790: 72 72 6f 72 20 6d 65 73 73 61 67 65 20 74 6f 20  rror message to 
27a0: 74 68 65 20 75 73 65 72 20 61 6e 64 20 61 62 6f  the user and abo
27b0: 72 74 73 20 74 68 65 20 73 79 6e 63 0a 6f 70 65  rts the sync.ope
27c0: 72 61 74 69 6f 6e 2e 20 20 41 6e 20 65 72 72 6f  ration.  An erro
27d0: 72 20 63 61 72 64 20 6c 6f 6f 6b 73 20 6c 69 6b  r card looks lik
27e0: 65 20 74 68 69 73 3a 3c 2f 70 3e 0a 0a 3c 62 6c  e this:</p>..<bl
27f0: 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62 3e 65 72 72  ockquote>.<b>err
2800: 6f 72 3c 2f 62 3e 20 3c 69 3e 65 72 72 6f 72 2d  or</b> <i>error-
2810: 6d 65 73 73 61 67 65 3c 2f 69 3e 0a 3c 2f 62 6c  message</i>.</bl
2820: 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e 54 68  ockquote>..<p>Th
2830: 65 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65 20  e error message 
2840: 69 73 20 45 6e 67 6c 69 73 68 20 74 65 78 74 20  is English text 
2850: 74 68 61 74 20 69 73 20 65 6e 63 6f 64 65 64 20  that is encoded 
2860: 69 6e 20 6f 72 64 65 72 20 74 6f 0a 62 65 20 61  in order to.be a
2870: 20 73 69 6e 67 6c 65 20 74 6f 6b 65 6e 2e 0a 41   single token..A
2880: 20 73 70 61 63 65 20 28 41 53 43 49 49 20 30 78   space (ASCII 0x
2890: 32 30 29 20 69 73 20 72 65 70 72 65 73 65 6e 74  20) is represent
28a0: 65 64 20 61 73 20 22 5c 73 22 20 28 41 53 43 49  ed as "\s" (ASCI
28b0: 49 20 30 78 35 43 2c 20 30 78 37 33 29 2e 20 20  I 0x5C, 0x73).  
28c0: 41 0a 6e 65 77 6c 69 6e 65 20 28 41 53 43 49 49  A.newline (ASCII
28d0: 20 30 78 30 61 29 20 69 73 20 22 5c 6e 22 20 28   0x0a) is "\n" (
28e0: 41 53 43 49 49 20 30 78 36 43 2c 20 78 36 45 29  ASCII 0x6C, x6E)
28f0: 2e 20 20 41 20 62 61 63 6b 73 6c 61 73 68 20 0a  .  A backslash .
2900: 28 41 53 43 49 49 20 30 78 35 43 29 20 69 73 20  (ASCII 0x5C) is 
2910: 72 65 70 72 65 73 65 6e 74 65 64 20 61 73 20 74  represented as t
2920: 77 6f 20 62 61 63 6b 73 6c 61 73 68 65 73 20 22  wo backslashes "
2930: 5c 5c 22 2e 20 20 41 70 61 72 74 20 66 72 6f 6d  \\".  Apart from
2940: 0a 73 70 61 63 65 20 61 6e 64 20 6e 65 77 6c 69  .space and newli
2950: 6e 65 2c 20 6e 6f 20 6f 74 68 65 72 20 77 68 69  ne, no other whi
2960: 74 65 73 70 61 63 65 20 63 68 61 72 61 63 74 65  tespace characte
2970: 72 73 20 6e 6f 72 20 61 6e 79 0a 75 6e 70 72 69  rs nor any.unpri
2980: 6e 74 61 62 6c 65 20 63 68 61 72 61 63 74 65 72  ntable character
2990: 73 20 61 72 65 20 61 6c 6c 6f 77 65 64 20 69 6e  s are allowed in
29a0: 0a 74 68 65 20 65 72 72 6f 72 20 6d 65 73 73 61  .the error messa
29b0: 67 65 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 32 2e 31  ge.</p>..<h3>2.1
29c0: 30 20 55 6e 6b 6e 6f 77 6e 20 43 61 72 64 73 3c  0 Unknown Cards<
29d0: 2f 68 33 3e 0a 0a 3c 70 3e 49 66 20 65 69 74 68  /h3>..<p>If eith
29e0: 65 72 20 74 68 65 20 63 6c 69 65 6e 74 20 6f 72  er the client or
29f0: 20 74 68 65 20 73 65 72 76 65 72 20 73 65 65 73   the server sees
2a00: 20 61 20 63 61 72 64 20 74 68 61 74 20 69 73 20   a card that is 
2a10: 6e 6f 74 0a 64 65 73 63 72 69 62 65 64 20 61 62  not.described ab
2a20: 6f 76 65 2c 20 74 68 65 6e 20 69 74 20 67 65 6e  ove, then it gen
2a30: 65 72 61 74 65 73 20 61 6e 20 65 72 72 6f 72 20  erates an error 
2a40: 61 6e 64 20 61 62 6f 72 74 73 2e 3c 2f 70 3e 0a  and aborts.</p>.
2a50: 0a 3c 68 32 3e 33 2e 30 20 50 68 61 6e 74 6f 6d  .<h2>3.0 Phantom
2a60: 73 20 41 6e 64 20 43 6c 75 73 74 65 72 73 3c 2f  s And Clusters</
2a70: 68 32 3e 0a 0a 3c 70 3e 57 68 65 6e 20 61 20 72  h2>..<p>When a r
2a80: 65 70 6f 73 69 74 6f 72 79 20 6b 6e 6f 77 73 20  epository knows 
2a90: 74 68 61 74 20 61 20 66 69 6c 65 20 65 78 69 73  that a file exis
2aa0: 74 73 20 61 6e 64 20 6b 6e 6f 77 73 20 74 68 65  ts and knows the
2ab0: 20 55 55 49 44 20 6f 66 0a 74 68 61 74 20 66 69   UUID of.that fi
2ac0: 6c 65 2c 20 62 75 74 20 69 74 20 64 6f 65 73 20  le, but it does 
2ad0: 6e 6f 74 20 6b 6e 6f 77 20 74 68 65 20 66 69 6c  not know the fil
2ae0: 65 20 63 6f 6e 74 65 6e 74 2c 20 74 68 65 6e 20  e content, then 
2af0: 69 74 20 73 74 6f 72 65 73 20 74 68 61 74 0a 66  it stores that.f
2b00: 69 6c 65 20 61 73 20 61 20 22 70 68 61 6e 74 6f  ile as a "phanto
2b10: 6d 22 2e 20 20 41 20 72 65 70 6f 73 69 74 6f 72  m".  A repositor
2b20: 79 20 77 69 6c 6c 20 74 79 70 69 63 61 6c 6c 79  y will typically
2b30: 20 63 72 65 61 74 65 20 61 20 70 68 61 6e 74 6f   create a phanto
2b40: 6d 20 77 68 65 6e 0a 69 74 20 72 65 63 65 69 76  m when.it receiv
2b50: 65 73 20 61 6e 20 69 67 6f 74 20 63 61 72 64 20  es an igot card 
2b60: 66 6f 72 20 61 20 66 69 6c 65 20 74 68 61 74 20  for a file that 
2b70: 69 74 20 64 6f 65 73 20 6e 6f 74 20 68 6f 6c 64  it does not hold
2b80: 20 6f 72 20 77 68 65 6e 20 69 74 0a 72 65 63 65   or when it.rece
2b90: 69 76 65 73 20 61 20 66 69 6c 65 20 63 61 72 64  ives a file card
2ba0: 20 74 68 61 74 20 72 65 66 65 72 65 6e 63 65 73   that references
2bb0: 20 61 20 64 65 6c 74 61 20 73 6f 75 72 63 65 20   a delta source 
2bc0: 74 68 61 74 20 69 74 20 64 6f 65 73 20 6e 6f 74  that it does not
2bd0: 0a 68 6f 6c 64 2e 20 20 57 68 65 6e 20 61 20 73  .hold.  When a s
2be0: 65 72 76 65 72 20 69 73 20 67 65 6e 65 72 61 74  erver is generat
2bf0: 69 6e 67 20 69 74 73 20 72 65 70 6c 79 20 6f 72  ing its reply or
2c00: 20 77 68 65 6e 20 61 20 63 6c 69 65 6e 74 20 69   when a client i
2c10: 73 0a 67 65 6e 65 72 61 74 69 6e 67 20 61 20 6e  s.generating a n
2c20: 65 77 20 72 65 71 75 65 73 74 2c 20 69 74 20 77  ew request, it w
2c30: 69 6c 6c 20 75 73 75 61 6c 6c 79 20 73 65 6e 64  ill usually send
2c40: 20 67 69 6d 6d 65 20 63 61 72 64 73 20 66 6f 72   gimme cards for
2c50: 20 65 76 65 72 79 0a 70 68 61 6e 74 6f 6d 20 74   every.phantom t
2c60: 68 61 74 20 69 74 20 68 6f 6c 64 73 2e 3c 2f 70  hat it holds.</p
2c70: 3e 0a 0a 3c 70 3e 41 20 63 6c 75 73 74 65 72 20  >..<p>A cluster 
2c80: 69 73 20 61 20 73 70 65 63 69 61 6c 20 66 69 6c  is a special fil
2c90: 65 20 74 68 61 74 20 74 65 6c 6c 73 20 6f 66 20  e that tells of 
2ca0: 74 68 65 20 65 78 69 73 74 65 6e 63 65 20 6f 66  the existence of
2cb0: 20 6f 74 68 65 72 0a 66 69 6c 65 73 2e 20 20 41   other.files.  A
2cc0: 6e 79 20 66 69 6c 65 20 69 6e 20 74 68 65 20 72  ny file in the r
2cd0: 65 70 6f 73 69 74 6f 72 79 20 74 68 61 74 20 66  epository that f
2ce0: 6f 6c 6c 6f 77 73 20 74 68 65 20 73 79 6e 74 61  ollows the synta
2cf0: 63 74 69 63 20 72 75 6c 65 73 0a 6f 66 20 61 20  ctic rules.of a 
2d00: 63 6c 75 73 74 65 72 20 69 73 20 63 6f 6e 73 69  cluster is consi
2d10: 64 65 72 65 64 20 61 20 63 6c 75 73 74 65 72 2e  dered a cluster.
2d20: 3c 2f 70 3e 0a 0a 3c 70 3e 41 20 63 6c 75 73 74  </p>..<p>A clust
2d30: 65 72 20 69 73 20 61 20 6c 69 6e 65 20 6f 72 69  er is a line ori
2d40: 65 6e 74 65 64 20 66 69 6c 65 2e 20 20 45 61 63  ented file.  Eac
2d50: 68 20 6c 69 6e 65 20 6f 66 20 61 20 63 6c 75 73  h line of a clus
2d60: 74 65 72 0a 69 73 20 61 20 63 61 72 64 2e 20 20  ter.is a card.  
2d70: 54 68 65 20 63 61 72 64 73 20 61 72 65 20 73 65  The cards are se
2d80: 70 61 72 61 74 65 64 20 62 79 20 74 68 65 20 6e  parated by the n
2d90: 65 77 6c 69 6e 65 20 28 22 5c 6e 22 29 20 63 68  ewline ("\n") ch
2da0: 61 72 61 63 74 65 72 2e 0a 45 61 63 68 20 63 61  aracter..Each ca
2db0: 72 64 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 61  rd consists of a
2dc0: 20 73 69 6e 67 6c 65 20 63 68 61 72 61 63 74 65   single characte
2dd0: 72 20 63 61 72 64 20 74 79 70 65 2c 20 61 20 73  r card type, a s
2de0: 70 61 63 65 2c 20 61 6e 64 20 61 0a 73 69 6e 67  pace, and a.sing
2df0: 6c 65 20 61 72 67 75 6d 65 6e 74 2e 20 20 4e 6f  le argument.  No
2e00: 20 65 78 74 72 61 20 77 68 69 74 65 73 70 61 63   extra whitespac
2e10: 65 20 61 6e 64 20 6e 6f 20 74 72 61 69 6c 69 6e  e and no trailin
2e20: 67 20 6f 72 20 6c 65 61 64 69 6e 67 0a 77 68 69  g or leading.whi
2e30: 74 65 73 70 61 63 65 20 69 73 20 61 6c 6c 6f 77  tespace is allow
2e40: 65 64 2e 20 20 41 6c 6c 20 63 61 72 64 73 20 69  ed.  All cards i
2e50: 6e 20 74 68 65 20 63 6c 75 73 74 65 72 20 6d 75  n the cluster mu
2e60: 73 74 20 6f 63 63 75 72 20 69 6e 0a 73 74 72 69  st occur in.stri
2e70: 63 74 20 6c 65 78 69 63 6f 67 72 61 70 68 69 63  ct lexicographic
2e80: 61 6c 20 6f 72 64 65 72 2e 3c 2f 70 3e 0a 0a 3c  al order.</p>..<
2e90: 70 3e 41 20 63 6c 75 73 74 65 72 20 63 6f 6e 73  p>A cluster cons
2ea0: 69 73 74 73 20 6f 66 20 6f 6e 65 20 6f 72 20 6d  ists of one or m
2eb0: 6f 72 65 20 22 4d 22 20 63 61 72 64 73 20 66 6f  ore "M" cards fo
2ec0: 6c 6c 6f 77 65 64 20 62 79 20 61 20 73 69 6e 67  llowed by a sing
2ed0: 6c 65 0a 22 5a 22 20 63 61 72 64 2e 20 20 45 61  le."Z" card.  Ea
2ee0: 63 68 20 4d 20 63 61 72 64 20 68 6f 6c 64 73 20  ch M card holds 
2ef0: 61 6e 20 61 72 67 75 6d 65 6e 74 20 77 68 69 63  an argument whic
2f00: 68 20 69 73 20 61 20 55 55 49 44 20 66 6f 72 20  h is a UUID for 
2f10: 61 20 66 69 6c 65 0a 69 6e 20 74 68 65 20 72 65  a file.in the re
2f20: 70 6f 73 69 74 6f 72 79 2e 20 20 54 68 65 20 5a  pository.  The Z
2f30: 20 63 61 72 64 20 68 61 73 20 61 20 73 69 6e 67   card has a sing
2f40: 6c 65 20 61 72 67 75 6d 65 6e 74 20 77 68 69 63  le argument whic
2f50: 68 20 69 73 20 74 68 65 0a 6c 6f 77 65 72 2d 63  h is the.lower-c
2f60: 61 73 65 20 68 65 78 61 64 65 63 69 6d 61 6c 20  ase hexadecimal 
2f70: 72 65 70 72 65 73 65 6e 74 61 74 69 6f 6e 20 6f  representation o
2f80: 66 20 74 68 65 20 4d 44 35 20 63 68 65 63 6b 73  f the MD5 checks
2f90: 75 6d 20 6f 66 20 61 6c 6c 0a 70 72 65 63 65 64  um of all.preced
2fa0: 69 6e 67 20 4d 20 63 61 72 64 73 20 75 70 20 74  ing M cards up t
2fb0: 6f 20 61 6e 64 20 69 6e 63 6c 75 64 65 64 20 74  o and included t
2fc0: 68 65 20 6e 65 77 6c 69 6e 65 20 63 68 61 72 61  he newline chara
2fd0: 63 74 65 72 20 74 68 61 74 0a 6f 63 63 75 72 72  cter that.occurr
2fe0: 65 64 20 6a 75 73 74 20 62 65 66 6f 72 65 20 74  ed just before t
2ff0: 68 65 20 5a 20 74 68 61 74 20 73 74 61 72 74 73  he Z that starts
3000: 20 74 68 65 20 5a 20 63 61 72 64 2e 3c 2f 70 3e   the Z card.</p>
3010: 0a 0a 3c 70 3e 41 6e 79 20 66 69 6c 65 20 74 68  ..<p>Any file th
3020: 61 74 20 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63  at does not matc
3030: 68 20 74 68 65 20 73 70 65 63 69 66 69 63 61 74  h the specificat
3040: 69 6f 6e 73 20 6f 66 20 61 20 63 6c 75 73 74 65  ions of a cluste
3050: 72 0a 65 78 61 63 74 6c 79 20 69 73 20 6e 6f 74  r.exactly is not
3060: 20 61 20 63 6c 75 73 74 65 72 2e 20 20 54 68 65   a cluster.  The
3070: 72 65 20 6d 75 73 74 20 62 65 20 6e 6f 20 65 78  re must be no ex
3080: 74 72 61 20 77 68 69 74 65 73 70 61 63 65 20 69  tra whitespace i
3090: 6e 0a 74 68 65 20 66 69 6c 65 2e 20 20 54 68 65  n.the file.  The
30a0: 72 65 20 6d 75 73 74 20 62 65 20 6f 6e 65 20 6f  re must be one o
30b0: 72 20 6d 6f 72 65 20 4d 20 63 61 72 64 73 2e 20  r more M cards. 
30c0: 20 54 68 65 72 65 20 6d 75 73 74 20 62 65 20 61   There must be a
30d0: 0a 73 69 6e 67 6c 65 20 5a 20 63 61 72 64 20 77  .single Z card w
30e0: 69 74 68 20 61 20 63 6f 72 72 65 63 74 20 4d 44  ith a correct MD
30f0: 35 20 63 68 65 63 6b 73 75 6d 2e 20 20 41 6e 64  5 checksum.  And
3100: 20 61 6c 6c 20 63 61 72 64 73 20 6d 75 73 74 0a   all cards must.
3110: 62 65 20 69 6e 20 73 74 72 69 63 74 20 6c 65 78  be in strict lex
3120: 69 63 6f 67 72 61 70 68 69 63 61 6c 20 6f 72 64  icographical ord
3130: 65 72 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 33 2e 31  er.</p>..<h3>3.1
3140: 20 54 68 65 20 55 6e 63 6c 75 73 74 65 72 65 64   The Unclustered
3150: 20 54 61 62 6c 65 3c 2f 68 33 3e 0a 0a 3c 70 3e   Table</h3>..<p>
3160: 45 76 65 72 79 20 72 65 70 6f 73 69 74 6f 72 79  Every repository
3170: 20 6d 61 69 6e 74 61 69 6e 73 20 61 20 74 61 62   maintains a tab
3180: 6c 65 20 6e 61 6d 65 64 20 22 3c 62 3e 75 6e 63  le named "<b>unc
3190: 6c 75 73 74 65 72 65 64 3c 2f 62 3e 22 0a 77 68  lustered</b>".wh
31a0: 69 63 68 20 72 65 63 6f 72 64 73 20 74 68 65 20  ich records the 
31b0: 69 64 65 6e 74 69 74 79 20 6f 66 20 65 76 65 72  identity of ever
31c0: 79 20 66 69 6c 65 20 61 6e 64 20 70 68 61 6e 74  y file and phant
31d0: 6f 6d 20 69 74 20 68 6f 6c 64 73 20 74 68 61 74  om it holds that
31e0: 20 69 73 20 6e 6f 74 0a 6d 65 6e 74 69 6f 6e 65   is not.mentione
31f0: 64 20 69 6e 20 61 20 63 6c 75 73 74 65 72 2e 20  d in a cluster. 
3200: 20 54 68 65 20 65 6e 74 72 69 65 73 20 69 6e 20   The entries in 
3210: 74 68 65 20 75 6e 63 6c 75 73 74 65 72 65 64 20  the unclustered 
3220: 74 61 62 6c 65 20 63 61 6e 0a 62 65 20 74 68 6f  table can.be tho
3230: 75 67 68 74 20 6f 66 20 61 73 20 6c 65 61 76 65  ught of as leave
3240: 73 20 6f 6e 20 61 20 74 72 65 65 20 6f 66 20 66  s on a tree of f
3250: 69 6c 65 73 2e 20 20 53 6f 6d 65 20 6f 66 20 74  iles.  Some of t
3260: 68 65 20 75 6e 63 6c 75 73 74 65 72 65 64 0a 66  he unclustered.f
3270: 69 6c 65 73 20 77 69 6c 6c 20 62 65 20 63 6c 75  iles will be clu
3280: 73 74 65 72 73 2e 20 20 54 68 6f 73 65 20 63 6c  sters.  Those cl
3290: 75 73 74 65 72 73 20 6d 61 79 20 63 6f 6e 74 61  usters may conta
32a0: 69 6e 20 6f 74 68 65 72 20 63 6c 75 73 74 65 72  in other cluster
32b0: 73 2c 0a 77 68 69 63 68 20 6d 69 67 68 74 20 63  s,.which might c
32c0: 6f 6e 74 61 69 6e 20 73 74 69 6c 6c 20 6d 6f 72  ontain still mor
32d0: 65 20 63 6c 75 73 74 65 72 73 2c 20 61 6e 64 20  e clusters, and 
32e0: 73 6f 20 66 6f 72 74 68 2e 20 20 42 65 67 69 6e  so forth.  Begin
32f0: 6e 69 6e 67 0a 77 69 74 68 20 74 68 65 20 66 69  ning.with the fi
3300: 6c 65 73 20 69 6e 20 74 68 65 20 75 6e 63 6c 75  les in the unclu
3310: 73 74 65 72 65 64 20 74 61 62 6c 65 2c 20 6f 6e  stered table, on
3320: 65 20 63 61 6e 20 66 6f 6c 6c 6f 77 20 74 68 65  e can follow the
3330: 20 63 68 61 69 6e 0a 6f 66 20 63 6c 75 73 74 65   chain.of cluste
3340: 72 73 20 74 6f 20 66 69 6e 64 20 65 76 65 72 79  rs to find every
3350: 20 66 69 6c 65 20 69 6e 20 74 68 65 20 72 65 70   file in the rep
3360: 6f 73 69 74 6f 72 79 2e 3c 2f 70 3e 0a 0a 3c 68  ository.</p>..<h
3370: 32 3e 34 2e 30 20 53 79 6e 63 68 72 6f 6e 69 7a  2>4.0 Synchroniz
3380: 61 74 69 6f 6e 20 53 74 72 61 74 65 67 69 65 73  ation Strategies
3390: 3c 2f 68 32 3e 0a 0a 3c 68 33 3e 34 2e 31 20 50  </h2>..<h3>4.1 P
33a0: 75 6c 6c 3c 2f 68 33 3e 0a 0a 3c 70 3e 41 20 74  ull</h3>..<p>A t
33b0: 79 70 69 63 61 6c 20 70 75 6c 6c 20 6f 70 65 72  ypical pull oper
33c0: 61 74 69 6f 6e 20 70 72 6f 63 65 65 64 73 20 61  ation proceeds a
33d0: 73 20 73 68 6f 77 6e 20 62 65 6c 6f 77 2e 20 20  s shown below.  
33e0: 44 65 74 61 69 6c 73 0a 6f 66 20 74 68 65 20 61  Details.of the a
33f0: 63 74 75 61 6c 20 69 6d 70 6c 65 6d 65 6e 74 61  ctual implementa
3400: 74 69 6f 6e 20 6d 61 79 20 76 65 72 79 20 73 6c  tion may very sl
3410: 69 67 68 74 6c 79 20 62 75 74 20 74 68 65 20 67  ightly but the g
3420: 69 73 74 20 6f 66 0a 61 20 70 75 6c 6c 20 69 73  ist of.a pull is
3430: 20 63 61 70 74 75 72 65 64 20 69 6e 20 74 68 65   captured in the
3440: 20 66 6f 6c 6c 6f 77 69 6e 67 20 73 74 65 70 73   following steps
3450: 3a 3c 2f 70 3e 0a 0a 3c 6f 6c 3e 0a 3c 6c 69 3e  :</p>..<ol>.<li>
3460: 54 68 65 20 63 6c 69 65 6e 74 20 73 65 6e 64 73  The client sends
3470: 20 6c 6f 67 69 6e 20 61 6e 64 20 70 75 6c 6c 20   login and pull 
3480: 63 61 72 64 73 2e 0a 3c 6c 69 3e 54 68 65 20 63  cards..<li>The c
3490: 6c 69 65 6e 74 20 73 65 6e 64 73 20 61 20 63 6f  lient sends a co
34a0: 6f 6b 69 65 20 63 61 72 64 20 69 66 20 69 74 20  okie card if it 
34b0: 68 61 73 20 70 72 65 76 69 6f 75 73 6c 79 20 72  has previously r
34c0: 65 63 65 69 76 65 64 20 61 20 63 6f 6f 6b 69 65  eceived a cookie
34d0: 2e 0a 3c 6c 69 3e 54 68 65 20 63 6c 69 65 6e 74  ..<li>The client
34e0: 20 73 65 6e 64 73 20 67 69 6d 6d 65 20 63 61 72   sends gimme car
34f0: 64 73 20 66 6f 72 20 65 76 65 72 79 20 70 68 61  ds for every pha
3500: 6e 74 6f 6d 20 74 68 61 74 20 69 74 20 68 6f 6c  ntom that it hol
3510: 64 73 2e 0a 3c 68 72 3e 0a 3c 6c 69 3e 54 68 65  ds..<hr>.<li>The
3520: 20 73 65 72 76 65 72 20 63 68 65 63 6b 73 20 74   server checks t
3530: 68 65 20 6c 6f 67 69 6e 20 70 61 73 73 77 6f 72  he login passwor
3540: 64 20 61 6e 64 20 72 65 6a 65 63 74 73 20 74 68  d and rejects th
3550: 65 20 73 65 73 73 69 6f 6e 20 69 66 0a 74 68 65  e session if.the
3560: 20 75 73 65 72 20 64 6f 65 73 20 6e 6f 74 20 68   user does not h
3570: 61 76 65 20 70 65 72 6d 69 73 73 69 6f 6e 20 74  ave permission t
3580: 6f 20 70 75 6c 6c 2e 0a 3c 6c 69 3e 49 66 20 74  o pull..<li>If t
3590: 68 65 20 6e 75 6d 62 65 72 20 65 6e 74 72 69 65  he number entrie
35a0: 73 20 69 6e 20 74 68 65 20 75 6e 63 6c 75 73 74  s in the unclust
35b0: 65 72 65 64 20 74 61 62 6c 65 20 6f 6e 20 74 68  ered table on th
35c0: 65 20 73 65 72 76 65 72 20 69 73 0a 67 72 65 61  e server is.grea
35d0: 74 65 72 20 74 68 61 6e 20 31 30 30 2c 20 74 68  ter than 100, th
35e0: 65 6e 20 74 68 65 20 73 65 72 76 65 72 20 63 6f  en the server co
35f0: 6e 73 74 72 75 63 74 73 20 61 20 6e 65 77 20 63  nstructs a new c
3600: 6c 75 73 74 65 72 20 66 69 6c 65 20 74 6f 0a 63  luster file to.c
3610: 6f 76 65 72 20 61 6c 6c 20 74 68 6f 73 65 20 75  over all those u
3620: 6e 63 6c 75 73 74 65 72 65 64 20 65 6e 74 72 69  nclustered entri
3630: 65 73 2e 0a 3c 6c 69 3e 54 68 65 20 73 65 72 76  es..<li>The serv
3640: 65 72 20 73 65 6e 64 73 20 66 69 6c 65 20 63 61  er sends file ca
3650: 72 64 73 20 66 6f 72 20 65 76 65 72 79 20 67 69  rds for every gi
3660: 6d 6d 65 20 63 61 72 64 20 69 74 20 72 65 63 65  mme card it rece
3670: 69 76 65 64 0a 66 72 6f 6d 20 74 68 65 20 63 6c  ived.from the cl
3680: 69 65 6e 74 2e 0a 3c 6c 69 3e 54 68 65 20 73 65  ient..<li>The se
3690: 72 76 65 72 20 73 65 6e 64 73 20 69 68 61 76 65  rver sends ihave
36a0: 20 63 61 72 64 73 20 66 6f 72 20 65 76 65 72 79   cards for every
36b0: 20 66 69 6c 65 20 69 6e 20 69 74 73 20 75 6e 63   file in its unc
36c0: 6c 75 73 74 65 72 65 64 0a 74 61 62 6c 65 20 74  lustered.table t
36d0: 68 61 74 20 69 73 20 6e 6f 74 20 61 20 70 68 61  hat is not a pha
36e0: 6e 74 6f 6d 2e 0a 3c 68 72 3e 0a 3c 6c 69 3e 54  ntom..<hr>.<li>T
36f0: 68 65 20 63 6c 69 65 6e 74 20 61 64 64 73 20 74  he client adds t
3700: 68 65 20 63 6f 6e 74 65 6e 74 20 6f 66 20 66 69  he content of fi
3710: 6c 65 20 63 61 72 64 73 20 74 6f 20 69 74 73 20  le cards to its 
3720: 72 65 70 6f 73 69 74 6f 72 79 2e 0a 3c 6c 69 3e  repository..<li>
3730: 54 68 65 20 63 6c 69 65 6e 74 20 63 72 65 61 74  The client creat
3740: 65 73 20 61 20 70 68 61 6e 74 6f 6d 20 66 6f 72  es a phantom for
3750: 20 65 76 65 72 79 20 69 68 61 76 65 20 63 61 72   every ihave car
3760: 64 20 69 6e 20 74 68 65 20 73 65 72 76 65 72 20  d in the server 
3770: 72 65 70 6c 79 0a 74 68 61 74 20 6d 65 6e 74 69  reply.that menti
3780: 6f 6e 73 20 61 20 66 69 6c 65 20 74 68 61 74 20  ons a file that 
3790: 74 68 65 20 63 6c 69 65 6e 74 20 64 6f 65 73 20  the client does 
37a0: 6e 6f 74 20 70 6f 73 73 65 73 73 2e 0a 3c 6c 69  not possess..<li
37b0: 3e 54 68 65 20 63 6c 69 65 6e 74 20 63 72 65 61  >The client crea
37c0: 74 65 73 20 61 20 70 68 61 6e 74 6f 6d 20 66 6f  tes a phantom fo
37d0: 72 20 74 68 65 20 64 65 6c 74 61 20 73 6f 75 72  r the delta sour
37e0: 63 65 20 6f 66 20 66 69 6c 65 20 63 61 72 64 73  ce of file cards
37f0: 20 77 68 65 6e 0a 74 68 65 20 64 65 6c 74 61 20   when.the delta 
3800: 73 6f 75 72 63 65 20 69 73 20 61 20 66 69 6c 65  source is a file
3810: 20 74 68 61 74 20 74 68 65 20 63 6c 69 65 6e 74   that the client
3820: 20 64 6f 65 73 20 6e 6f 74 20 70 6f 73 73 65 73   does not posses
3830: 73 2e 0a 3c 2f 6f 6c 3e 0a 0a 3c 70 3e 54 68 65  s..</ol>..<p>The
3840: 73 65 20 74 65 6e 20 73 74 65 70 73 20 72 65 70  se ten steps rep
3850: 72 65 73 65 6e 74 20 61 20 73 69 6e 67 6c 65 20  resent a single 
3860: 48 54 54 50 20 72 6f 75 6e 64 2d 74 72 69 70 20  HTTP round-trip 
3870: 72 65 71 75 65 73 74 2e 0a 54 68 65 20 66 69 72  request..The fir
3880: 73 74 20 74 68 72 65 65 20 73 74 65 70 73 20 61  st three steps a
3890: 72 65 20 74 68 65 20 70 72 6f 63 65 73 73 69 6e  re the processin
38a0: 67 20 74 68 61 74 20 6f 63 63 75 72 73 20 6f 6e  g that occurs on
38b0: 20 74 68 65 20 63 6c 69 65 6e 74 0a 74 6f 20 67   the client.to g
38c0: 65 6e 65 72 61 74 65 20 74 68 65 20 72 65 71 75  enerate the requ
38d0: 65 73 74 2e 20 20 54 68 65 20 6d 69 64 64 6c 65  est.  The middle
38e0: 20 66 6f 75 72 20 73 74 65 70 73 20 61 72 65 20   four steps are 
38f0: 70 72 6f 63 65 73 73 69 6e 67 0a 74 68 61 74 20  processing.that 
3900: 6f 63 63 75 72 73 20 6f 6e 20 74 68 65 20 73 65  occurs on the se
3910: 72 76 65 72 20 74 6f 20 69 6e 74 65 72 70 72 65  rver to interpre
3920: 74 20 74 68 65 20 72 65 71 75 65 73 74 20 61 6e  t the request an
3930: 64 20 67 65 6e 65 72 61 74 65 20 61 0a 72 65 70  d generate a.rep
3940: 6c 79 2e 20 20 41 6e 64 20 74 68 65 20 6c 61 73  ly.  And the las
3950: 74 20 74 68 72 65 65 20 73 74 65 70 73 20 61 72  t three steps ar
3960: 65 20 74 68 65 20 70 72 6f 63 65 73 73 69 6e 67  e the processing
3970: 20 74 68 61 74 20 74 68 65 0a 63 6c 69 65 6e 74   that the.client
3980: 20 64 6f 65 73 20 74 6f 20 69 6e 74 65 72 70 72   does to interpr
3990: 65 74 20 74 68 65 20 72 65 70 6c 79 2e 3c 2f 70  et the reply.</p
39a0: 3e 0a 0a 3c 70 3e 44 75 72 69 6e 67 20 61 20 70  >..<p>During a p
39b0: 75 6c 6c 2c 20 74 68 65 20 63 6c 69 65 6e 74 20  ull, the client 
39c0: 77 69 6c 6c 20 6b 65 65 70 20 73 65 6e 64 69 6e  will keep sendin
39d0: 67 20 48 54 54 50 20 72 65 71 75 65 73 74 73 0a  g HTTP requests.
39e0: 75 6e 74 69 6c 20 69 74 20 68 6f 6c 64 73 20 61  until it holds a
39f0: 6c 6c 20 66 69 6c 65 73 20 74 68 61 74 20 65 78  ll files that ex
3a00: 69 73 74 20 6f 6e 20 74 68 65 20 73 65 72 76 65  ist on the serve
3a10: 72 2e 3c 2f 70 3e 0a 0a 3c 70 3e 4e 6f 74 65 20  r.</p>..<p>Note 
3a20: 74 68 61 74 20 74 68 65 20 73 65 72 76 65 72 20  that the server 
3a30: 74 72 69 65 73 0a 74 6f 20 6c 69 6d 69 74 20 74  tries.to limit t
3a40: 68 65 20 73 69 7a 65 20 6f 66 20 69 74 73 20 72  he size of its r
3a50: 65 70 6c 79 20 6d 65 73 73 61 67 65 20 74 6f 20  eply message to 
3a60: 73 6f 6d 65 74 68 69 6e 67 20 72 65 61 73 6f 6e  something reason
3a70: 61 62 6c 65 0a 28 75 73 75 61 6c 6c 79 20 61 62  able.(usually ab
3a80: 6f 75 74 20 31 4d 42 29 20 73 6f 20 74 68 61 74  out 1MB) so that
3a90: 20 69 74 20 6d 69 67 68 74 20 73 74 6f 70 20 73   it might stop s
3aa0: 65 6e 64 69 6e 67 20 66 69 6c 65 20 63 61 72 64  ending file card
3ab0: 73 20 61 73 0a 64 65 73 63 72 69 62 65 64 20 69  s as.described i
3ac0: 6e 20 73 74 65 70 20 28 36 29 20 69 66 20 74 68  n step (6) if th
3ad0: 65 20 72 65 70 6c 79 20 62 65 63 6f 6d 65 73 20  e reply becomes 
3ae0: 74 6f 6f 20 6c 61 72 67 65 2e 3c 2f 70 3e 0a 0a  too large.</p>..
3af0: 3c 70 3e 53 74 65 70 20 28 35 29 20 69 73 20 74  <p>Step (5) is t
3b00: 68 65 20 6f 6e 6c 79 20 77 61 79 20 69 6e 20 77  he only way in w
3b10: 68 69 63 68 20 6e 65 77 20 63 6c 75 73 74 65 72  hich new cluster
3b20: 73 20 63 61 6e 20 62 65 20 63 72 65 61 74 65 64  s can be created
3b30: 2e 0a 42 79 20 6f 6e 6c 79 20 63 72 65 61 74 69  ..By only creati
3b40: 6e 67 20 63 6c 75 73 74 65 72 73 20 6f 6e 20 74  ng clusters on t
3b50: 68 65 20 73 65 72 76 65 72 2c 20 77 65 20 68 6f  he server, we ho
3b60: 70 65 20 74 6f 20 6d 69 6e 69 6d 69 7a 65 20 74  pe to minimize t
3b70: 68 65 0a 61 6d 6f 75 6e 74 20 6f 66 20 6f 76 65  he.amount of ove
3b80: 72 6c 61 70 20 62 65 74 77 65 65 6e 20 63 6c 75  rlap between clu
3b90: 73 74 65 72 73 20 69 6e 20 74 68 65 20 63 6f 6d  sters in the com
3ba0: 6d 6f 6e 20 63 6f 6e 66 69 67 75 72 61 74 69 6f  mon configuratio
3bb0: 6e 20 77 68 65 72 65 0a 74 68 65 72 65 20 69 73  n where.there is
3bc0: 20 61 20 73 69 6e 67 6c 65 20 73 65 72 76 65 72   a single server
3bd0: 20 61 6e 64 20 6d 61 6e 79 20 63 6c 69 65 6e 74   and many client
3be0: 73 2e 20 20 54 68 65 20 73 61 6d 65 20 73 79 6e  s.  The same syn
3bf0: 63 68 72 6f 6e 69 7a 61 74 69 6f 6e 0a 70 72 6f  chronization.pro
3c00: 74 6f 63 6f 6c 20 77 69 6c 6c 20 63 6f 6e 74 69  tocol will conti
3c10: 6e 75 65 20 74 6f 20 77 6f 72 6b 20 65 76 65 6e  nue to work even
3c20: 20 69 66 20 74 68 65 72 65 20 61 72 65 20 6d 75   if there are mu
3c30: 6c 74 69 70 6c 65 20 73 65 72 76 65 72 73 0a 6f  ltiple servers.o
3c40: 72 20 69 66 20 73 65 72 76 65 72 73 20 61 6e 64  r if servers and
3c50: 20 63 6c 69 65 6e 74 73 20 73 6f 6d 65 74 69 6d   clients sometim
3c60: 65 73 20 63 68 61 6e 67 65 20 72 6f 6c 65 73 2e  es change roles.
3c70: 20 20 54 68 65 20 6f 6e 6c 79 20 6e 65 67 61 74    The only negat
3c80: 69 76 65 0a 65 66 66 65 63 74 73 20 6f 66 20 74  ive.effects of t
3c90: 68 65 73 65 20 75 6e 75 73 75 61 6c 20 61 72 72  hese unusual arr
3ca0: 61 6e 67 65 6d 65 6e 74 73 20 69 73 20 74 68 61  angements is tha
3cb0: 74 20 6d 6f 72 65 20 74 68 61 6e 20 74 68 65 20  t more than the 
3cc0: 6d 69 6e 69 6d 75 6d 0a 6e 75 6d 62 65 72 20 6f  minimum.number o
3cd0: 66 20 63 6c 75 73 74 65 72 73 20 6d 69 67 68 74  f clusters might
3ce0: 20 62 65 20 67 65 6e 65 72 61 74 65 64 2e 3c 2f   be generated.</
3cf0: 70 3e 0a 0a 3c 68 33 3e 34 2e 32 20 50 75 73 68  p>..<h3>4.2 Push
3d00: 3c 2f 68 33 3e 0a 0a 3c 70 3e 41 20 74 79 70 69  </h3>..<p>A typi
3d10: 63 61 6c 20 70 75 73 68 20 6f 70 65 72 61 74 69  cal push operati
3d20: 6f 6e 20 70 72 6f 63 65 65 64 73 20 72 6f 75 67  on proceeds roug
3d30: 68 6c 79 20 61 73 20 73 68 6f 77 6e 20 62 65 6c  hly as shown bel
3d40: 6f 77 2e 20 20 41 73 0a 77 69 74 68 20 61 20 70  ow.  As.with a p
3d50: 75 6c 6c 2c 20 74 68 65 20 61 63 74 75 61 6c 20  ull, the actual 
3d60: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 6d  implementation m
3d70: 61 79 20 76 61 72 79 20 73 6c 69 67 68 74 6c 79  ay vary slightly
3d80: 2e 3c 2f 70 3e 0a 0a 3c 6f 6c 3e 0a 3c 6c 69 3e  .</p>..<ol>.<li>
3d90: 54 68 65 20 63 6c 69 65 6e 74 20 73 65 6e 64 73  The client sends
3da0: 20 6c 6f 67 69 6e 20 61 6e 64 20 70 75 73 68 20   login and push 
3db0: 63 61 72 64 73 2e 0a 3c 6c 69 3e 54 68 65 20 63  cards..<li>The c
3dc0: 6c 69 65 6e 74 20 73 65 6e 64 73 20 66 69 6c 65  lient sends file
3dd0: 20 63 61 72 64 73 20 66 6f 72 20 61 6e 79 20 66   cards for any f
3de0: 69 6c 65 73 20 74 68 61 74 20 69 74 20 68 6f 6c  iles that it hol
3df0: 64 73 20 74 68 61 74 20 68 61 76 65 0a 6e 65 76  ds that have.nev
3e00: 65 72 20 62 65 66 6f 72 65 20 62 65 65 6e 20 70  er before been p
3e10: 75 73 68 65 64 20 2d 20 66 69 6c 65 73 20 74 68  ushed - files th
3e20: 61 74 20 63 6f 6d 65 20 66 72 6f 6d 20 6c 6f 63  at come from loc
3e30: 61 6c 20 63 68 65 63 6b 2d 69 6e 73 2e 0a 3c 6c  al check-ins..<l
3e40: 69 3e 49 66 20 74 68 69 73 20 69 73 20 74 68 65  i>If this is the
3e50: 20 73 65 63 6f 6e 64 20 6f 72 20 6c 61 74 65 72   second or later
3e60: 20 63 79 63 6c 65 20 69 6e 20 61 20 70 75 73 68   cycle in a push
3e70: 2c 20 74 68 65 6e 20 74 68 65 0a 63 6c 69 65 6e  , then the.clien
3e80: 74 20 73 65 6e 64 73 20 66 69 6c 65 20 63 61 72  t sends file car
3e90: 64 73 20 66 6f 72 20 61 6e 79 20 67 69 6d 6d 65  ds for any gimme
3ea0: 20 63 61 72 64 73 20 74 68 61 74 20 74 68 65 20   cards that the 
3eb0: 73 65 72 76 65 72 20 73 65 6e 74 0a 69 6e 20 74  server sent.in t
3ec0: 68 65 20 70 72 65 76 69 6f 75 73 20 63 79 63 6c  he previous cycl
3ed0: 65 2e 0a 3c 6c 69 3e 54 68 65 20 63 6c 69 65 6e  e..<li>The clien
3ee0: 74 20 73 65 6e 64 73 20 69 67 6f 74 20 63 61 72  t sends igot car
3ef0: 64 73 20 66 6f 72 20 65 76 65 72 79 20 66 69 6c  ds for every fil
3f00: 65 20 69 6e 20 69 74 73 20 75 6e 63 6c 75 73 74  e in its unclust
3f10: 65 72 65 64 20 74 61 62 6c 65 0a 74 68 61 74 20  ered table.that 
3f20: 69 73 20 6e 6f 74 20 61 20 70 68 61 6e 74 6f 6d  is not a phantom
3f30: 2e 0a 3c 68 72 3e 0a 3c 6c 69 3e 54 68 65 20 73  ..<hr>.<li>The s
3f40: 65 72 76 65 72 20 63 68 65 63 6b 73 20 74 68 65  erver checks the
3f50: 20 6c 6f 67 69 6e 20 61 6e 64 20 70 75 73 68 20   login and push 
3f60: 63 61 72 64 73 20 61 6e 64 20 69 73 73 75 65 73  cards and issues
3f70: 20 61 6e 20 65 72 72 6f 72 20 69 66 0a 61 6e 79   an error if.any
3f80: 74 68 69 6e 67 20 69 73 20 61 6d 69 73 73 2e 0a  thing is amiss..
3f90: 3c 6c 69 3e 54 68 65 20 73 65 72 76 65 72 20 61  <li>The server a
3fa0: 63 63 65 70 74 73 20 66 69 6c 65 20 63 61 72 64  ccepts file card
3fb0: 73 20 66 72 6f 6d 20 74 68 65 20 63 6c 69 65 6e  s from the clien
3fc0: 74 20 61 6e 64 20 61 64 64 73 20 74 68 6f 73 65  t and adds those
3fd0: 20 66 69 6c 65 73 0a 74 6f 20 69 74 73 20 72 65   files.to its re
3fe0: 70 6f 73 69 74 6f 72 79 2e 0a 3c 6c 69 3e 54 68  pository..<li>Th
3ff0: 65 20 73 65 72 76 65 72 20 63 72 65 61 74 65 73  e server creates
4000: 20 70 68 61 6e 74 6f 6d 73 20 66 6f 72 20 69 67   phantoms for ig
4010: 6f 74 20 63 61 72 64 73 20 74 68 61 74 20 6d 65  ot cards that me
4020: 6e 74 69 6f 6e 20 66 69 6c 65 73 20 69 74 0a 64  ntion files it.d
4030: 6f 65 73 20 6e 6f 74 20 70 6f 73 73 65 73 73 20  oes not possess 
4040: 6f 72 20 66 6f 72 20 66 69 6c 65 20 63 61 72 64  or for file card
4050: 73 20 74 68 61 74 20 6d 65 6e 74 69 6f 6e 20 64  s that mention d
4060: 65 6c 74 61 20 73 6f 75 72 63 65 20 66 69 6c 65  elta source file
4070: 73 20 74 68 61 74 0a 69 74 20 64 6f 65 73 20 6e  s that.it does n
4080: 6f 74 20 70 6f 73 73 65 73 73 2e 0a 3c 6c 69 3e  ot possess..<li>
4090: 54 68 65 20 73 65 72 76 65 72 20 69 73 73 75 65  The server issue
40a0: 73 20 67 69 6d 6d 65 20 63 61 72 64 73 20 66 6f  s gimme cards fo
40b0: 72 20 61 6c 6c 20 70 68 61 6e 74 6f 6d 73 2e 0a  r all phantoms..
40c0: 3c 68 72 3e 0a 3c 6c 69 3e 54 68 65 20 63 6c 69  <hr>.<li>The cli
40d0: 65 6e 74 20 72 65 6d 65 6d 62 65 72 73 20 74 68  ent remembers th
40e0: 65 20 67 69 6d 6d 65 20 63 61 72 64 73 20 66 72  e gimme cards fr
40f0: 6f 6d 20 74 68 65 20 73 65 72 76 65 72 20 73 6f  om the server so
4100: 20 74 68 61 74 20 69 74 0a 63 61 6e 20 67 65 6e   that it.can gen
4110: 65 72 61 74 65 20 66 69 6c 65 20 63 61 72 64 73  erate file cards
4120: 20 69 6e 20 72 65 70 6c 79 20 6f 6e 20 74 68 65   in reply on the
4130: 20 6e 65 78 74 20 63 79 63 6c 65 2e 0a 3c 2f 6f   next cycle..</o
4140: 6c 3e 0a 0a 3c 70 3e 41 73 20 77 69 74 68 20 61  l>..<p>As with a
4150: 20 70 75 6c 6c 2c 20 74 68 65 20 73 74 65 70 73   pull, the steps
4160: 20 6f 66 20 61 20 70 75 73 68 20 6f 70 65 72 61   of a push opera
4170: 74 69 6f 6e 20 72 65 70 65 61 74 20 75 6e 74 69  tion repeat unti
4180: 6c 20 74 68 65 0a 73 65 72 76 65 72 20 6b 6e 6f  l the.server kno
4190: 77 73 20 61 6c 6c 20 66 69 6c 65 73 20 74 68 61  ws all files tha
41a0: 74 20 65 78 69 73 74 20 6f 6e 20 74 68 65 20 63  t exist on the c
41b0: 6c 69 65 6e 74 2e 20 20 41 6c 73 6f 2c 20 61 73  lient.  Also, as
41c0: 20 77 69 74 68 0a 70 75 6c 6c 2c 20 74 68 65 20   with.pull, the 
41d0: 63 6c 69 65 6e 74 20 61 74 74 65 6d 70 74 73 20  client attempts 
41e0: 74 6f 20 6b 65 65 70 20 74 68 65 20 73 69 7a 65  to keep the size
41f0: 20 6f 66 20 74 68 65 20 72 65 71 75 65 73 74 20   of the request 
4200: 66 72 6f 6d 0a 67 72 6f 77 69 6e 67 20 74 6f 6f  from.growing too
4210: 20 6c 61 72 67 65 20 62 79 20 73 75 70 70 72 65   large by suppre
4220: 73 73 69 6e 67 20 66 69 6c 65 20 63 61 72 64 73  ssing file cards
4230: 20 6f 6e 63 65 20 74 68 65 0a 73 69 7a 65 20 6f   once the.size o
4240: 66 20 74 68 65 20 72 65 71 75 65 73 74 20 72 65  f the request re
4250: 61 63 68 65 73 20 31 4d 42 2e 3c 2f 70 3e 0a 0a  aches 1MB.</p>..
4260: 3c 68 33 3e 34 2e 33 20 53 79 6e 63 3c 2f 68 33  <h3>4.3 Sync</h3
4270: 3e 0a 0a 3c 70 3e 41 20 73 79 6e 63 20 69 73 20  >..<p>A sync is 
4280: 6a 75 73 74 20 61 20 70 75 6c 6c 20 61 6e 64 20  just a pull and 
4290: 61 20 70 75 73 68 20 74 68 61 74 20 68 61 70 70  a push that happ
42a0: 65 6e 20 61 74 20 74 68 65 20 73 61 6d 65 20 74  en at the same t
42b0: 69 6d 65 2e 0a 54 68 65 20 66 69 72 73 74 20 74  ime..The first t
42c0: 68 72 65 65 20 73 74 65 70 73 20 6f 66 20 61 20  hree steps of a 
42d0: 70 75 6c 6c 20 61 72 65 20 63 6f 6d 62 69 6e 65  pull are combine
42e0: 64 20 77 69 74 68 20 74 68 65 20 66 69 72 73 74  d with the first
42f0: 20 66 69 76 65 20 73 74 65 70 73 0a 6f 66 20 61   five steps.of a
4300: 20 70 75 73 68 2e 20 20 53 74 65 70 73 20 28 34   push.  Steps (4
4310: 29 20 74 68 72 6f 75 67 68 20 28 37 29 20 6f 66  ) through (7) of
4320: 20 61 20 70 75 6c 6c 20 61 72 65 20 63 6f 6d 62   a pull are comb
4330: 69 6e 65 64 20 77 69 74 68 20 73 74 65 70 73 0a  ined with steps.
4340: 28 35 29 20 74 68 72 6f 75 67 68 20 28 38 29 20  (5) through (8) 
4350: 6f 66 20 61 20 70 75 73 68 2e 20 20 41 6e 64 20  of a push.  And 
4360: 73 74 65 70 73 20 28 38 29 20 74 68 72 6f 75 67  steps (8) throug
4370: 68 20 28 31 30 29 20 6f 66 20 61 20 70 75 6c 6c  h (10) of a pull
4380: 0a 61 72 65 20 63 6f 6d 62 69 6e 65 64 20 77 69  .are combined wi
4390: 74 68 20 73 74 65 70 20 28 39 29 20 6f 66 20 61  th step (9) of a
43a0: 20 70 75 73 68 2e 3c 2f 70 3e 0a 0a 3c 68 32 3e   push.</p>..<h2>
43b0: 35 2e 30 20 53 75 6d 6d 61 72 79 3c 2f 68 32 3e  5.0 Summary</h2>
43c0: 0a 0a 3c 70 3e 48 65 72 65 20 61 72 65 20 74 68  ..<p>Here are th
43d0: 65 20 6b 65 79 20 70 6f 69 6e 74 73 20 6f 66 20  e key points of 
43e0: 74 68 65 20 73 79 6e 63 68 72 6f 6e 69 7a 61 74  the synchronizat
43f0: 69 6f 6e 20 70 72 6f 74 6f 63 6f 6c 3a 3c 2f 70  ion protocol:</p
4400: 3e 0a 0a 3c 6f 6c 3e 0a 3c 6c 69 3e 54 68 65 20  >..<ol>.<li>The 
4410: 63 6c 69 65 6e 74 20 73 65 6e 64 73 20 6f 6e 65  client sends one
4420: 20 6f 72 20 6d 6f 72 65 20 50 55 53 48 20 48 54   or more PUSH HT
4430: 54 50 20 72 65 71 75 65 73 74 73 20 74 6f 20 74  TP requests to t
4440: 68 65 20 73 65 72 76 65 72 2e 0a 20 20 20 20 54  he server..    T
4450: 68 65 20 72 65 71 75 65 73 74 20 61 6e 64 20 72  he request and r
4460: 65 70 6c 79 20 63 6f 6e 74 65 6e 74 20 74 79 70  eply content typ
4470: 65 20 69 73 20 22 61 70 70 6c 69 63 61 74 69 6f  e is "applicatio
4480: 6e 2f 78 2d 66 6f 73 73 69 6c 22 2e 0a 3c 6c 69  n/x-fossil"..<li
4490: 3e 48 54 54 50 20 72 65 71 75 65 73 74 20 63 6f  >HTTP request co
44a0: 6e 74 65 6e 74 20 69 73 20 63 6f 6d 70 72 65 73  ntent is compres
44b0: 73 65 64 20 75 73 69 6e 67 20 7a 6c 69 62 2e 0a  sed using zlib..
44c0: 3c 6c 69 3e 54 68 65 20 63 6f 6e 74 65 6e 74 20  <li>The content 
44d0: 6f 66 20 72 65 71 75 65 73 74 20 61 6e 64 20 72  of request and r
44e0: 65 70 6c 79 20 63 6f 6e 73 69 73 74 73 20 6f 66  eply consists of
44f0: 20 63 61 72 64 73 20 77 69 74 68 20 6f 6e 65 0a   cards with one.
4500: 20 20 20 20 63 61 72 64 20 70 65 72 20 6c 69 6e      card per lin
4510: 65 2e 20 20 0a 3c 6c 69 3e 43 61 72 64 20 66 6f  e.  .<li>Card fo
4520: 72 6d 61 74 73 20 61 72 65 3a 0a 20 20 20 20 3c  rmats are:.    <
4530: 75 6c 3e 0a 20 20 20 20 3c 6c 69 3e 20 3c 62 3e  ul>.    <li> <b>
4540: 6c 6f 67 69 6e 3c 2f 62 3e 20 3c 69 3e 75 73 65  login</b> <i>use
4550: 72 69 64 20 6e 6f 6e 63 65 20 73 69 67 6e 61 74  rid nonce signat
4560: 75 72 65 3c 2f 69 3e 0a 20 20 20 20 3c 6c 69 3e  ure</i>.    <li>
4570: 20 3c 62 3e 70 75 73 68 3c 2f 62 3e 20 3c 69 3e   <b>push</b> <i>
4580: 73 65 72 76 65 72 63 6f 64 65 20 70 72 6f 6a 65  servercode proje
4590: 63 74 63 6f 64 65 3c 2f 69 3e 0a 20 20 20 20 3c  ctcode</i>.    <
45a0: 6c 69 3e 20 3c 62 3e 70 75 6c 6c 3c 2f 62 3e 20  li> <b>pull</b> 
45b0: 3c 69 3e 73 65 72 76 65 72 63 6f 64 65 20 70 72  <i>servercode pr
45c0: 6f 6a 65 63 74 63 6f 64 65 3c 2f 69 3e 0a 20 20  ojectcode</i>.  
45d0: 20 20 3c 6c 69 3e 20 3c 62 3e 63 6c 6f 6e 65 3c    <li> <b>clone<
45e0: 2f 62 3e 0a 20 20 20 20 3c 6c 69 3e 20 3c 62 3e  /b>.    <li> <b>
45f0: 66 69 6c 65 3c 2f 62 3e 20 3c 69 3e 75 75 69 64  file</b> <i>uuid
4600: 20 73 69 7a 65 3c 2f 69 3e 20 3c 62 3e 5c 6e 3c   size</i> <b>\n<
4610: 2f 62 3e 20 3c 69 3e 63 6f 6e 74 65 6e 74 3c 2f  /b> <i>content</
4620: 69 3e 0a 20 20 20 20 3c 6c 69 3e 20 3c 62 3e 66  i>.    <li> <b>f
4630: 69 6c 65 3c 2f 62 3e 20 3c 69 3e 75 75 69 64 20  ile</b> <i>uuid 
4640: 64 65 6c 74 61 2d 75 75 69 64 20 73 69 7a 65 3c  delta-uuid size<
4650: 2f 69 3e 20 3c 62 3e 5c 6e 3c 2f 62 3e 20 3c 69  /i> <b>\n</b> <i
4660: 3e 63 6f 6e 74 65 6e 74 3c 2f 69 3e 0a 20 20 20  >content</i>.   
4670: 20 3c 6c 69 3e 20 3c 62 3e 69 67 6f 74 3c 2f 62   <li> <b>igot</b
4680: 3e 20 3c 69 3e 75 75 69 64 3c 2f 69 3e 0a 20 20  > <i>uuid</i>.  
4690: 20 20 3c 6c 69 3e 20 3c 62 3e 67 69 6d 6d 65 3c    <li> <b>gimme<
46a0: 2f 62 3e 20 3c 69 3e 75 75 69 64 3c 2f 69 3e 0a  /b> <i>uuid</i>.
46b0: 20 20 20 20 3c 6c 69 3e 20 3c 62 3e 63 6f 6f 6b      <li> <b>cook
46c0: 69 65 3c 2f 62 3e 20 20 3c 69 3e 63 6f 6f 6b 69  ie</b>  <i>cooki
46d0: 65 2d 74 65 78 74 3c 2f 69 3e 0a 20 20 20 20 3c  e-text</i>.    <
46e0: 6c 69 3e 20 3c 62 3e 65 72 72 6f 72 3c 2f 62 3e  li> <b>error</b>
46f0: 20 3c 69 3e 65 72 72 6f 72 2d 6d 65 73 73 61 67   <i>error-messag
4700: 65 3c 2f 69 3e 0a 20 20 20 20 3c 2f 75 6c 3e 0a  e</i>.    </ul>.
4710: 3c 6c 69 3e 50 68 61 6e 74 6f 6d 73 20 61 72 65  <li>Phantoms are
4720: 20 66 69 6c 65 73 20 74 68 61 74 20 61 20 72 65   files that a re
4730: 70 6f 73 69 74 6f 72 79 20 6b 6e 6f 77 73 20 65  pository knows e
4740: 78 69 73 74 20 62 75 74 20 64 6f 65 73 20 6e 6f  xist but does no
4750: 74 20 70 6f 73 73 65 73 73 2e 0a 3c 6c 69 3e 43  t possess..<li>C
4760: 6c 75 73 74 65 72 73 20 61 72 65 20 66 69 6c 65  lusters are file
4770: 73 20 74 68 61 74 20 63 6f 6e 74 61 69 6e 20 74  s that contain t
4780: 68 65 20 55 55 49 44 73 20 6f 66 20 6f 74 68 65  he UUIDs of othe
4790: 72 20 66 69 6c 65 73 2e 0a 3c 6c 69 3e 43 6c 75  r files..<li>Clu
47a0: 73 74 65 72 73 20 61 72 65 20 63 72 65 61 74 65  sters are create
47b0: 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20  d automatically 
47c0: 6f 6e 20 74 68 65 20 73 65 72 76 65 72 20 64 75  on the server du
47d0: 72 69 6e 67 20 61 20 70 75 6c 6c 2e 0a 3c 6c 69  ring a pull..<li
47e0: 3e 52 65 70 6f 73 69 74 6f 72 69 65 73 20 6b 65  >Repositories ke
47f0: 65 70 20 74 72 61 63 6b 20 6f 66 20 61 6c 6c 20  ep track of all 
4800: 66 69 6c 65 73 20 74 68 61 74 20 61 72 65 20 6e  files that are n
4810: 6f 74 20 6e 61 6d 65 64 20 69 6e 20 61 6e 79 0a  ot named in any.
4820: 63 6c 75 73 74 65 72 20 61 6e 64 20 73 65 6e 64  cluster and send
4830: 20 69 67 6f 74 20 6d 65 73 73 61 67 65 73 20 66   igot messages f
4840: 6f 72 20 74 68 6f 73 65 20 66 69 6c 65 73 2e 0a  or those files..
4850: 3c 6c 69 3e 52 65 70 6f 73 69 74 6f 72 69 65 73  <li>Repositories
4860: 20 6b 65 65 70 20 74 72 61 63 6b 20 6f 66 20 61   keep track of a
4870: 6c 6c 20 74 68 65 20 70 68 61 6e 74 6f 6d 73 20  ll the phantoms 
4880: 74 68 65 79 20 68 6f 6c 64 20 61 6e 64 20 73 65  they hold and se
4890: 6e 64 0a 67 69 6d 6d 65 20 6d 65 73 73 61 67 65  nd.gimme message
48a0: 73 20 66 6f 72 20 74 68 6f 73 65 20 66 69 6c 65  s for those file
48b0: 73 2e 0a 3c 2f 6f 6c 3e 0a 0a 3c 2f 62 6f 64 79  s..</ol>..</body
48c0: 3e 0a 3c 2f 68 74 6d 6c 3e 0a                    >.</html>.