Hex Artifact Content
Not logged in

Artifact 7118e0761e54f63d69cb3938ac42adbaefb9322d:

File www/sync.wiki part of check-in [efb759a07d] - Change the default subsystem list for tickets to an empty set. Update documentation to begin making a clearer distinction between local state and global state. by drh on 2008-10-26 02:16:51.

0000: 3c 68 31 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65  <h1 align="cente
0010: 72 22 3e 54 68 65 20 46 6f 73 73 69 6c 20 53 79  r">The Fossil Sy
0020: 6e 63 20 50 72 6f 74 6f 63 6f 6c 3c 2f 68 31 3e  nc Protocol</h1>
0030: 0a 0a 3c 70 3e 46 6f 73 73 69 6c 20 73 75 70 70  ..<p>Fossil supp
0040: 6f 72 74 73 20 63 6f 6d 6d 61 6e 64 73 20 3c 62  orts commands <b
0050: 3e 70 75 73 68 3c 2f 62 3e 2c 20 3c 62 3e 70 75  >push</b>, <b>pu
0060: 6c 6c 3c 2f 62 3e 2c 20 61 6e 64 20 3c 62 3e 73  ll</b>, and <b>s
0070: 79 6e 63 3c 2f 62 3e 0a 66 6f 72 20 74 72 61 6e  ync</b>.for tran
0080: 73 66 65 72 72 69 6e 67 20 69 6e 66 6f 72 6d 61  sferring informa
0090: 74 69 6f 6e 20 66 72 6f 6d 20 6f 6e 65 20 72 65  tion from one re
00a0: 70 6f 73 69 74 6f 72 79 20 74 6f 20 61 6e 6f 74  pository to anot
00b0: 68 65 72 2e 20 20 54 68 65 0a 63 6f 6d 6d 61 6e  her.  The.comman
00c0: 64 20 69 73 20 72 75 6e 20 6f 6e 20 74 68 65 20  d is run on the 
00d0: 63 6c 69 65 6e 74 20 72 65 70 6f 73 69 74 6f 72  client repositor
00e0: 79 2e 20 20 41 20 55 52 4c 20 66 6f 72 20 74 68  y.  A URL for th
00f0: 65 20 73 65 72 76 65 72 20 72 65 70 6f 73 69 74  e server reposit
0100: 6f 72 79 0a 69 73 20 73 70 65 63 69 66 69 65 64  ory.is specified
0110: 20 61 73 20 70 61 72 74 20 6f 66 20 74 68 65 20   as part of the 
0120: 63 6f 6d 6d 61 6e 64 2e 20 20 54 68 69 73 20 64  command.  This d
0130: 6f 63 75 6d 65 6e 74 20 64 65 73 63 72 69 62 65  ocument describe
0140: 73 20 77 68 61 74 20 68 61 70 70 65 6e 73 0a 62  s what happens.b
0150: 65 68 69 6e 64 20 74 68 65 20 73 63 65 6e 65 73  ehind the scenes
0160: 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 73 79 6e   in order to syn
0170: 63 68 72 6f 6e 69 7a 65 20 74 68 65 20 69 6e 66  chronize the inf
0180: 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 74 68 65 20  ormation on the 
0190: 74 77 6f 0a 72 65 70 6f 73 69 74 6f 72 69 65 73  two.repositories
01a0: 2e 3c 2f 70 3e 0a 0a 3c 68 32 3e 31 2e 30 20 4f  .</p>..<h2>1.0 O
01b0: 76 65 72 76 69 65 77 3c 2f 68 32 3e 0a 0a 3c 70  verview</h2>..<p
01c0: 3e 54 68 65 20 67 6c 6f 62 61 6c 20 73 74 61 74  >The global stat
01d0: 65 20 6f 66 20 61 20 66 6f 73 73 69 6c 20 72 65  e of a fossil re
01e0: 70 6f 73 69 74 6f 72 79 20 63 6f 6e 73 69 73 74  pository consist
01f0: 73 20 6f 66 20 61 6e 20 75 6e 6f 72 64 65 72 65  s of an unordere
0200: 64 0a 63 6f 6c 6c 65 63 74 69 6f 6e 20 6f 66 20  d.collection of 
0210: 61 72 74 69 66 61 63 74 73 2e 20 20 45 61 63 68  artifacts.  Each
0220: 20 61 72 74 69 66 61 63 74 20 69 73 20 69 64 65   artifact is ide
0230: 6e 74 69 66 69 65 64 20 62 79 20 69 74 73 20 53  ntified by its S
0240: 48 41 31 20 68 61 73 68 0a 65 78 70 72 65 73 73  HA1 hash.express
0250: 65 64 20 61 73 20 61 20 34 30 2d 63 68 61 72 61  ed as a 40-chara
0260: 63 74 65 72 20 6c 6f 77 65 72 2d 63 61 73 65 20  cter lower-case 
0270: 68 65 78 61 64 65 63 69 6d 61 6c 20 73 74 72 69  hexadecimal stri
0280: 6e 67 2e 0a 53 79 6e 63 68 72 6f 6e 69 7a 61 74  ng..Synchronizat
0290: 69 6f 6e 20 69 73 20 73 69 6d 70 6c 79 20 74 68  ion is simply th
02a0: 65 20 70 72 6f 63 65 73 73 20 6f 66 20 73 68 61  e process of sha
02b0: 72 69 6e 67 20 61 72 74 69 66 61 63 74 73 20 62  ring artifacts b
02c0: 65 74 77 65 65 6e 0a 73 65 72 76 65 72 73 20 73  etween.servers s
02d0: 6f 20 74 68 61 74 20 61 6c 6c 20 73 65 72 76 65  o that all serve
02e0: 72 73 20 68 61 76 65 20 63 6f 70 69 65 73 20 6f  rs have copies o
02f0: 66 20 61 6c 6c 20 61 72 74 69 66 61 63 74 73 2e  f all artifacts.
0300: 20 20 42 65 63 61 75 73 65 0a 61 72 74 69 66 61    Because.artifa
0310: 63 74 73 20 61 72 65 20 75 6e 6f 72 64 65 72 65  cts are unordere
0320: 64 2c 20 74 68 65 20 6f 72 64 65 72 20 69 6e 20  d, the order in 
0330: 77 68 69 63 68 20 61 72 74 69 66 61 63 74 73 20  which artifacts 
0340: 61 72 65 20 72 65 63 65 69 76 65 64 0a 61 74 20  are received.at 
0350: 61 20 73 65 72 76 65 72 20 69 73 20 69 6e 63 6f  a server is inco
0360: 6e 73 65 71 75 65 6e 74 69 61 6c 2e 20 20 49 74  nsequential.  It
0370: 20 69 73 20 61 73 73 75 6d 65 64 20 74 68 61 74   is assumed that
0380: 20 74 68 65 20 53 48 41 31 20 68 61 73 68 65 73   the SHA1 hashes
0390: 0a 6f 66 20 61 72 74 69 66 61 63 74 73 20 61 72  .of artifacts ar
03a0: 65 20 75 6e 69 71 75 65 20 2d 20 74 68 61 74 20  e unique - that 
03b0: 65 76 65 72 79 20 61 72 74 69 66 61 63 74 20 68  every artifact h
03c0: 61 73 20 61 20 64 69 66 66 65 72 65 6e 74 20 53  as a different S
03d0: 48 41 31 20 68 61 73 68 2e 0a 54 6f 20 61 20 66  HA1 hash..To a f
03e0: 69 72 73 74 20 61 70 70 72 6f 78 69 6d 61 74 69  irst approximati
03f0: 6f 6e 2c 20 73 79 6e 63 68 72 6f 6e 69 7a 61 74  on, synchronizat
0400: 69 6f 6e 20 70 72 6f 63 65 65 64 73 20 62 79 20  ion proceeds by 
0410: 73 68 61 72 69 6e 67 20 6c 69 73 74 73 20 0a 53  sharing lists .S
0420: 48 41 31 20 68 61 73 68 65 73 20 6f 66 20 61 76  HA1 hashes of av
0430: 61 69 6c 61 62 6c 65 20 61 72 74 69 66 61 63 74  ailable artifact
0440: 73 2c 20 74 68 65 6e 20 73 68 61 72 69 6e 67 20  s, then sharing 
0450: 74 68 6f 73 65 20 61 72 74 69 66 61 63 74 73 20  those artifacts 
0460: 74 68 61 74 0a 61 72 65 20 6e 6f 74 20 66 6f 75  that.are not fou
0470: 6e 64 20 6f 6e 20 6f 6e 65 20 73 69 64 65 20 6f  nd on one side o
0480: 72 20 74 68 65 20 6f 74 68 65 72 20 6f 66 20 74  r the other of t
0490: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e 20 20  he connection.  
04a0: 49 6e 20 70 72 61 63 74 69 63 65 2c 0a 61 20 72  In practice,.a r
04b0: 65 70 6f 73 69 74 6f 72 79 20 6d 69 67 68 74 20  epository might 
04c0: 63 6f 6e 74 61 69 6e 20 6d 69 6c 6c 69 6f 6e 73  contain millions
04d0: 20 6f 66 20 61 72 74 69 66 61 63 74 73 2e 20 20   of artifacts.  
04e0: 54 68 65 20 6c 69 73 74 20 6f 66 0a 53 48 41 31  The list of.SHA1
04f0: 20 68 61 73 68 65 73 20 66 6f 72 20 74 68 69 73   hashes for this
0500: 20 6d 61 6e 79 20 61 72 74 69 66 61 63 74 73 20   many artifacts 
0510: 63 61 6e 20 62 65 20 6c 61 72 67 65 2e 20 20 53  can be large.  S
0520: 6f 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 73 20  o optimizations 
0530: 61 72 65 0a 65 6d 70 6c 6f 79 65 64 20 74 68 61  are.employed tha
0540: 74 20 75 73 75 61 6c 6c 79 20 72 65 64 75 63 65  t usually reduce
0550: 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 53   the number of S
0560: 48 41 31 20 68 61 73 68 65 73 20 74 68 61 74 20  HA1 hashes that 
0570: 6e 65 65 64 20 74 6f 20 62 65 0a 73 68 61 72 65  need to be.share
0580: 64 20 74 6f 20 61 20 66 65 77 20 68 75 6e 64 72  d to a few hundr
0590: 65 64 2e 3c 2f 70 3e 0a 0a 3c 70 3e 45 61 63 68  ed.</p>..<p>Each
05a0: 20 72 65 70 6f 73 69 74 6f 72 79 20 61 6c 73 6f   repository also
05b0: 20 68 61 73 20 6c 6f 63 61 6c 20 73 74 61 74 65   has local state
05c0: 2e 20 20 54 68 65 20 6c 6f 63 61 6c 20 73 74 61  .  The local sta
05d0: 74 65 20 64 65 74 65 72 6d 69 6e 65 73 0a 74 68  te determines.th
05e0: 65 20 77 65 62 2d 70 61 67 65 20 66 6f 72 6d 61  e web-page forma
05f0: 74 74 69 6e 67 20 70 72 65 66 65 72 65 6e 63 65  tting preference
0600: 73 2c 20 61 75 74 68 6f 72 69 7a 65 64 20 75 73  s, authorized us
0610: 65 72 73 2c 20 74 69 63 6b 65 74 20 66 6f 72 6d  ers, ticket form
0620: 61 74 73 2c 0a 61 6e 64 20 73 69 6d 69 6c 61 72  ats,.and similar
0630: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 74 68 61   information tha
0640: 74 20 76 61 72 69 65 73 20 66 72 6f 6d 20 6f 6e  t varies from on
0650: 65 20 72 65 70 6f 73 69 74 6f 72 79 20 74 6f 20  e repository to 
0660: 61 6e 6f 74 68 65 72 2e 0a 54 68 65 20 6c 6f 63  another..The loc
0670: 61 6c 20 73 74 61 74 65 20 69 73 20 6e 6f 74 20  al state is not 
0680: 74 72 61 6e 73 66 65 72 65 64 20 62 79 20 74 68  transfered by th
0690: 65 20 3c 62 3e 70 75 73 68 3c 2f 62 3e 2c 20 3c  e <b>push</b>, <
06a0: 62 3e 70 75 6c 6c 3c 2f 62 3e 2c 0a 61 6e 64 20  b>pull</b>,.and 
06b0: 3c 62 3e 73 79 6e 63 3c 2f 62 3e 20 63 6f 6d 6d  <b>sync</b> comm
06c0: 61 6e 64 2c 20 74 68 6f 75 67 68 20 73 6f 6d 65  and, though some
06d0: 20 6c 6f 63 61 6c 20 73 74 61 74 65 20 69 73 20   local state is 
06e0: 74 72 61 6e 73 66 65 72 65 64 20 64 75 72 69 6e  transfered durin
06f0: 67 0a 61 20 3c 62 3e 63 6c 6f 6e 65 3c 2f 62 3e  g.a <b>clone</b>
0700: 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 69 6e 69   in order to ini
0710: 74 69 61 6c 69 7a 65 20 74 68 65 20 6c 6f 63 61  tialize the loca
0720: 6c 20 73 74 61 74 65 20 6f 66 20 74 68 65 20 6e  l state of the n
0730: 65 77 0a 72 65 70 6f 73 69 74 6f 72 79 2e 20 20  ew.repository.  
0740: 54 68 65 20 3c 62 3e 63 6f 6e 66 69 67 75 72 61  The <b>configura
0750: 74 69 6f 6e 20 70 75 73 68 3c 2f 62 3e 20 61 6e  tion push</b> an
0760: 64 20 3c 62 3e 63 6f 6e 66 69 67 75 72 61 74 69  d <b>configurati
0770: 6f 6e 20 70 75 6c 6c 3c 2f 62 3e 0a 63 6f 6d 6d  on pull</b>.comm
0780: 61 6e 64 73 20 63 61 6e 20 62 65 20 75 73 65 64  ands can be used
0790: 20 74 6f 20 73 65 6e 64 20 6f 72 20 72 65 63 65   to send or rece
07a0: 69 76 65 20 6c 6f 63 61 6c 20 73 74 61 74 65 2e  ive local state.
07b0: 3c 2f 70 3e 0a 0a 0a 3c 68 32 3e 32 2e 30 20 54  </p>...<h2>2.0 T
07c0: 72 61 6e 73 70 6f 72 74 3c 2f 68 32 3e 0a 0a 3c  ransport</h2>..<
07d0: 70 3e 41 6c 6c 20 63 6f 6d 6d 75 6e 69 63 61 74  p>All communicat
07e0: 69 6f 6e 20 62 65 74 77 65 65 6e 20 63 6c 69 65  ion between clie
07f0: 6e 74 20 61 6e 64 20 73 65 72 76 65 72 20 69 73  nt and server is
0800: 20 76 69 61 20 48 54 54 50 20 72 65 71 75 65 73   via HTTP reques
0810: 74 73 2e 0a 54 68 65 20 73 65 72 76 65 72 20 69  ts..The server i
0820: 73 20 6c 69 73 74 65 6e 69 6e 67 20 66 6f 72 20  s listening for 
0830: 69 6e 63 6f 6d 69 6e 67 20 48 54 54 50 20 72 65  incoming HTTP re
0840: 71 75 65 73 74 73 2e 20 20 54 68 65 20 63 6c 69  quests.  The cli
0850: 65 6e 74 0a 69 73 73 75 65 73 20 6f 6e 65 20 6f  ent.issues one o
0860: 72 20 6d 6f 72 65 20 48 54 54 50 20 72 65 71 75  r more HTTP requ
0870: 65 73 74 73 20 61 6e 64 20 72 65 63 65 69 76 65  ests and receive
0880: 73 20 72 65 70 6c 69 65 73 20 66 6f 72 20 65 61  s replies for ea
0890: 63 68 0a 72 65 71 75 65 73 74 2e 3c 2f 70 3e 0a  ch.request.</p>.
08a0: 0a 3c 70 3e 54 68 65 20 73 65 72 76 65 72 20 6d  .<p>The server m
08b0: 69 67 68 74 20 62 65 20 72 75 6e 6e 69 6e 67 20  ight be running 
08c0: 61 73 20 61 6e 20 69 6e 64 65 70 65 6e 64 65 6e  as an independen
08d0: 74 20 73 65 72 76 65 72 0a 75 73 69 6e 67 20 74  t server.using t
08e0: 68 65 20 3c 62 3e 73 65 72 76 65 72 3c 2f 62 3e  he <b>server</b>
08f0: 20 63 6f 6d 6d 61 6e 64 2c 20 6f 72 20 69 74 20   command, or it 
0900: 6d 69 67 68 74 20 62 65 20 6c 61 75 6e 63 68 65  might be launche
0910: 64 20 66 72 6f 6d 0a 69 6e 65 74 64 20 6f 72 20  d from.inetd or 
0920: 78 69 6e 65 74 64 20 75 73 69 6e 67 20 74 68 65  xinetd using the
0930: 20 3c 62 3e 68 74 74 70 3c 2f 62 3e 20 63 6f 6d   <b>http</b> com
0940: 6d 61 6e 64 2e 20 20 4f 72 20 74 68 65 20 73 65  mand.  Or the se
0950: 72 76 65 72 20 6d 69 67 68 74 0a 62 65 20 6c 61  rver might.be la
0960: 75 6e 63 68 65 64 20 66 72 6f 6d 20 43 47 49 2e  unched from CGI.
0970: 20 20 54 68 65 20 64 65 74 61 69 6c 73 20 6f 66    The details of
0980: 20 68 6f 77 20 74 68 65 20 73 65 72 76 65 72 20   how the server 
0990: 69 73 20 63 6f 6e 66 69 67 75 72 65 64 0a 74 6f  is configured.to
09a0: 20 22 6c 69 73 74 65 6e 22 20 66 6f 72 20 69 6e   "listen" for in
09b0: 63 6f 6d 69 6e 67 20 48 54 54 50 20 72 65 71 75  coming HTTP requ
09c0: 65 73 74 73 20 69 73 20 69 6d 6d 61 74 65 72 69  ests is immateri
09d0: 61 6c 2e 20 20 54 68 65 20 69 6d 70 6f 72 74 61  al.  The importa
09e0: 6e 74 0a 70 6f 69 6e 74 20 69 73 20 74 68 61 74  nt.point is that
09f0: 20 74 68 65 20 73 65 72 76 65 72 20 69 73 20 6c   the server is l
0a00: 69 73 74 65 6e 69 6e 67 20 66 6f 72 20 72 65 71  istening for req
0a10: 75 65 73 74 73 20 61 6e 64 20 74 68 65 20 63 6c  uests and the cl
0a20: 69 65 6e 74 0a 69 73 20 74 68 65 20 69 73 73 75  ient.is the issu
0a30: 65 72 20 6f 66 20 74 68 65 20 72 65 71 75 65 73  er of the reques
0a40: 74 73 2e 3c 2f 70 3e 0a 0a 3c 70 3e 41 20 73 69  ts.</p>..<p>A si
0a50: 6e 67 6c 65 20 70 75 73 68 2c 20 70 75 6c 6c 2c  ngle push, pull,
0a60: 20 6f 72 20 73 79 6e 63 20 6d 69 67 68 74 20 69   or sync might i
0a70: 6e 76 6f 6c 76 65 20 6d 75 6c 74 69 70 6c 65 20  nvolve multiple 
0a80: 48 54 54 50 20 72 65 71 75 65 73 74 73 2e 0a 54  HTTP requests..T
0a90: 68 65 20 63 6c 69 65 6e 74 20 6d 61 69 6e 74 61  he client mainta
0aa0: 69 6e 73 20 73 74 61 74 65 20 62 65 74 77 65 65  ins state betwee
0ab0: 6e 20 61 6c 6c 20 72 65 71 75 65 73 74 73 2e 20  n all requests. 
0ac0: 20 42 75 74 20 6f 6e 20 74 68 65 20 73 65 72 76   But on the serv
0ad0: 65 72 0a 73 69 64 65 2c 20 65 61 63 68 20 72 65  er.side, each re
0ae0: 71 75 65 73 74 20 69 73 20 69 6e 64 65 70 65 6e  quest is indepen
0af0: 64 65 6e 74 2e 20 20 54 68 65 20 73 65 72 76 65  dent.  The serve
0b00: 72 20 64 6f 65 73 20 6e 6f 74 20 70 72 65 73 65  r does not prese
0b10: 72 76 65 0a 61 6e 79 20 69 6e 66 6f 72 6d 61 74  rve.any informat
0b20: 69 6f 6e 20 61 62 6f 75 74 20 74 68 65 20 63 6c  ion about the cl
0b30: 69 65 6e 74 20 66 72 6f 6d 20 6f 6e 65 20 72 65  ient from one re
0b40: 71 75 65 73 74 20 74 6f 20 74 68 65 20 6e 65 78  quest to the nex
0b50: 74 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 32 2e 31 20  t.</p>..<h3>2.1 
0b60: 53 65 72 76 65 72 20 49 64 65 6e 74 69 66 69 63  Server Identific
0b70: 61 74 69 6f 6e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54  ation</h3>..<p>T
0b80: 68 65 20 73 65 72 76 65 72 20 69 73 20 69 64 65  he server is ide
0b90: 6e 74 69 66 69 65 64 20 62 79 20 61 20 55 52 4c  ntified by a URL
0ba0: 20 61 72 67 75 6d 65 6e 74 20 74 68 61 74 20 61   argument that a
0bb0: 63 63 6f 6d 70 61 6e 69 65 73 20 74 68 65 0a 70  ccompanies the.p
0bc0: 75 73 68 2c 20 70 75 6c 6c 2c 20 6f 72 20 73 79  ush, pull, or sy
0bd0: 6e 63 20 63 6f 6d 6d 61 6e 64 20 6f 6e 20 74 68  nc command on th
0be0: 65 20 63 6c 69 65 6e 74 2e 20 20 28 41 73 20 61  e client.  (As a
0bf0: 20 63 6f 6e 76 65 6e 69 65 6e 63 65 20 74 6f 0a   convenience to.
0c00: 75 73 65 72 73 2c 20 74 68 65 20 55 52 4c 20 63  users, the URL c
0c10: 61 6e 20 62 65 20 6f 6d 69 74 74 65 64 20 6f 6e  an be omitted on
0c20: 20 74 68 65 20 63 6c 69 65 6e 74 20 63 6f 6d 6d   the client comm
0c30: 61 6e 64 20 61 6e 64 20 74 68 65 20 73 61 6d 65  and and the same
0c40: 20 55 52 4c 0a 66 72 6f 6d 20 74 68 65 20 6d 6f   URL.from the mo
0c50: 73 74 20 72 65 63 65 6e 74 20 70 75 73 68 2c 20  st recent push, 
0c60: 70 75 6c 6c 2c 20 6f 72 20 73 79 6e 63 20 77 69  pull, or sync wi
0c70: 6c 6c 20 62 65 20 72 65 75 73 65 64 2e 20 20 54  ll be reused.  T
0c80: 68 69 73 20 73 61 76 65 73 0a 74 79 70 69 6e 67  his saves.typing
0c90: 20 69 6e 20 74 68 65 20 63 6f 6d 6d 6f 6e 20 63   in the common c
0ca0: 61 73 65 20 77 68 65 72 65 20 74 68 65 20 63 6c  ase where the cl
0cb0: 69 65 6e 74 20 64 6f 65 73 20 6d 75 6c 74 69 70  ient does multip
0cc0: 6c 65 20 73 79 6e 63 73 20 74 6f 0a 74 68 65 20  le syncs to.the 
0cd0: 73 61 6d 65 20 73 65 72 76 65 72 2e 29 3c 2f 70  same server.)</p
0ce0: 3e 0a 0a 3c 70 3e 54 68 65 20 63 6c 69 65 6e 74  >..<p>The client
0cf0: 20 6d 6f 64 69 66 69 65 73 20 74 68 65 20 55 52   modifies the UR
0d00: 4c 20 62 79 20 61 70 70 65 6e 64 69 6e 67 20 74  L by appending t
0d10: 68 65 20 6d 65 74 68 6f 64 20 6e 61 6d 65 20 22  he method name "
0d20: 3c 62 3e 2f 78 66 65 72 3c 2f 62 3e 22 0a 74 6f  <b>/xfer</b>".to
0d30: 20 74 68 65 20 65 6e 64 2e 20 20 46 6f 72 20 65   the end.  For e
0d40: 78 61 6d 70 6c 65 2c 20 69 66 20 74 68 65 20 55  xample, if the U
0d50: 52 4c 20 73 70 65 63 69 66 69 65 64 20 6f 6e 20  RL specified on 
0d60: 74 68 65 20 63 6c 69 65 6e 74 20 63 6f 6d 6d 61  the client comma
0d70: 6e 64 0a 6c 69 6e 65 20 69 73 3c 2f 70 3e 0a 0a  nd.line is</p>..
0d80: 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 68 74 74  <blockquote>.htt
0d90: 70 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 68  p://fossil-scm.h
0da0: 77 61 63 69 2e 63 6f 6d 2f 66 6f 73 73 69 6c 0a  waci.com/fossil.
0db0: 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c  </blockquote>..<
0dc0: 70 3e 54 68 65 6e 20 74 68 65 20 55 52 4c 20 74  p>Then the URL t
0dd0: 68 61 74 20 69 73 20 72 65 61 6c 6c 79 20 75 73  hat is really us
0de0: 65 64 20 74 6f 20 64 6f 20 74 68 65 20 73 79 6e  ed to do the syn
0df0: 63 68 72 6f 6e 69 7a 61 74 69 6f 6e 20 77 69 6c  chronization wil
0e00: 6c 0a 62 65 3a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63  l.be:</p>..<bloc
0e10: 6b 71 75 6f 74 65 3e 0a 68 74 74 70 3a 2f 2f 66  kquote>.http://f
0e20: 6f 73 73 69 6c 2d 73 63 6d 2e 68 77 61 63 69 2e  ossil-scm.hwaci.
0e30: 63 6f 6d 2f 66 6f 73 73 69 6c 2f 78 66 65 72 0a  com/fossil/xfer.
0e40: 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c  </blockquote>..<
0e50: 68 33 3e 32 2e 32 20 48 54 54 50 20 52 65 71 75  h3>2.2 HTTP Requ
0e60: 65 73 74 20 46 6f 72 6d 61 74 3c 2f 68 33 3e 0a  est Format</h3>.
0e70: 0a 3c 70 3e 54 68 65 20 63 6c 69 65 6e 74 20 61  .<p>The client a
0e80: 6c 77 61 79 73 20 73 65 6e 64 73 20 61 20 50 4f  lways sends a PO
0e90: 53 54 20 72 65 71 75 65 73 74 20 74 6f 20 74 68  ST request to th
0ea0: 65 20 73 65 72 76 65 72 2e 20 20 54 68 65 0a 67  e server.  The.g
0eb0: 65 6e 65 72 61 6c 20 66 6f 72 6d 61 74 20 6f 66  eneral format of
0ec0: 20 74 68 65 20 50 4f 53 54 20 72 65 71 75 65 73   the POST reques
0ed0: 74 20 69 73 20 61 73 20 66 6f 6c 6c 6f 77 73 3a  t is as follows:
0ee0: 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74  </p>..<blockquot
0ef0: 65 3e 3c 70 72 65 3e 0a 50 4f 53 54 20 2f 66 6f  e><pre>.POST /fo
0f00: 73 73 69 6c 2f 78 66 65 72 20 48 54 54 50 2f 31  ssil/xfer HTTP/1
0f10: 2e 30 0a 48 6f 73 74 3a 20 66 6f 73 73 69 6c 2d  .0.Host: fossil-
0f20: 73 63 6d 2e 68 77 61 63 69 2e 63 6f 6d 3a 38 30  scm.hwaci.com:80
0f30: 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 61  .Content-Type: a
0f40: 70 70 6c 69 63 61 74 69 6f 6e 2f 78 2d 66 6f 73  pplication/x-fos
0f50: 73 69 6c 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67  sil.Content-Leng
0f60: 74 68 3a 20 34 32 31 36 0a 0a 3c 69 3e 63 6f 6e  th: 4216..<i>con
0f70: 74 65 6e 74 2e 2e 2e 3c 2f 69 3e 0a 3c 2f 70 72  tent...</i>.</pr
0f80: 65 3e 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a  e></blockquote>.
0f90: 0a 3c 70 3e 49 6e 20 74 68 65 20 65 78 61 6d 70  .<p>In the examp
0fa0: 6c 65 20 61 62 6f 76 65 2c 20 74 68 65 20 70 61  le above, the pa
0fb0: 74 68 6e 61 6d 65 20 67 69 76 65 6e 20 61 66 74  thname given aft
0fc0: 65 72 20 74 68 65 20 50 4f 53 54 20 6b 65 79 77  er the POST keyw
0fd0: 6f 72 64 0a 6f 6e 20 74 68 65 20 66 69 72 73 74  ord.on the first
0fe0: 20 6c 69 6e 65 20 69 73 20 61 20 63 6f 70 79 20   line is a copy 
0ff0: 6f 66 20 74 68 65 20 55 52 4c 20 70 61 74 68 6e  of the URL pathn
1000: 61 6d 65 2e 20 20 54 68 65 20 48 6f 73 74 3a 20  ame.  The Host: 
1010: 70 61 72 61 6d 65 74 65 72 0a 69 73 20 61 6c 73  parameter.is als
1020: 6f 20 74 61 6b 65 6e 20 66 72 6f 6d 20 74 68 65  o taken from the
1030: 20 55 52 4c 2e 20 20 54 68 65 20 63 6f 6e 74 65   URL.  The conte
1040: 6e 74 20 74 79 70 65 20 69 73 20 61 6c 77 61 79  nt type is alway
1050: 73 20 65 69 74 68 65 72 0a 22 61 70 70 6c 69 63  s either."applic
1060: 61 74 69 6f 6e 2f 78 2d 66 6f 73 73 69 6c 22 20  ation/x-fossil" 
1070: 6f 72 20 22 61 70 70 6c 69 63 61 74 69 6f 6e 2f  or "application/
1080: 78 2d 66 6f 73 73 69 6c 2d 64 65 62 75 67 22 2e  x-fossil-debug".
1090: 20 20 54 68 65 20 22 78 2d 66 6f 73 73 69 6c 22    The "x-fossil"
10a0: 0a 63 6f 6e 74 65 6e 74 20 74 79 70 65 20 69 73  .content type is
10b0: 20 74 68 65 20 64 65 66 61 75 6c 74 2e 20 20 54   the default.  T
10c0: 68 65 20 6f 6e 6c 79 20 64 69 66 66 65 72 65 6e  he only differen
10d0: 63 65 20 69 73 20 74 68 61 74 20 22 78 2d 66 6f  ce is that "x-fo
10e0: 73 73 69 6c 22 0a 63 6f 6e 74 65 6e 74 20 69 73  ssil".content is
10f0: 20 63 6f 6d 70 72 65 73 73 65 64 20 75 73 69 6e   compressed usin
1100: 67 20 7a 6c 69 62 20 77 68 65 72 65 61 73 20 22  g zlib whereas "
1110: 78 2d 66 6f 73 73 69 6c 2d 64 65 62 75 67 22 20  x-fossil-debug" 
1120: 69 73 20 73 65 6e 74 0a 75 6e 63 6f 6d 70 72 65  is sent.uncompre
1130: 73 73 65 64 2e 3c 2f 70 3e 0a 0a 3c 70 3e 41 20  ssed.</p>..<p>A 
1140: 74 79 70 69 63 61 6c 20 72 65 70 6c 79 20 66 72  typical reply fr
1150: 6f 6d 20 74 68 65 20 73 65 72 76 65 72 20 6d 69  om the server mi
1160: 67 68 74 20 6c 6f 6f 6b 20 73 6f 6d 65 74 68 69  ght look somethi
1170: 6e 67 20 6c 69 6b 65 20 74 68 69 73 3a 3c 2f 70  ng like this:</p
1180: 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 3c  >..<blockquote><
1190: 70 72 65 3e 0a 48 54 54 50 2f 31 2e 30 20 32 30  pre>.HTTP/1.0 20
11a0: 30 20 4f 4b 0a 44 61 74 65 3a 20 4d 6f 6e 2c 20  0 OK.Date: Mon, 
11b0: 31 30 20 53 65 70 20 32 30 30 37 20 31 32 3a 32  10 Sep 2007 12:2
11c0: 31 3a 30 31 20 47 4d 54 0a 43 6f 6e 6e 65 63 74  1:01 GMT.Connect
11d0: 69 6f 6e 3a 20 63 6c 6f 73 65 0a 43 61 63 68 65  ion: close.Cache
11e0: 2d 63 6f 6e 74 72 6f 6c 3a 20 70 72 69 76 61 74  -control: privat
11f0: 65 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20  e.Content-Type: 
1200: 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 2d 66 6f  application/x-fo
1210: 73 73 69 6c 3b 20 63 68 61 72 73 65 74 3d 55 53  ssil; charset=US
1220: 2d 41 53 43 49 49 0a 43 6f 6e 74 65 6e 74 2d 4c  -ASCII.Content-L
1230: 65 6e 67 74 68 3a 20 32 36 35 0a 0a 3c 69 3e 63  ength: 265..<i>c
1240: 6f 6e 74 65 6e 74 2e 2e 2e 3c 2f 69 3e 0a 3c 2f  ontent...</i>.</
1250: 70 72 65 3e 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65  pre></blockquote
1260: 3e 0a 0a 3c 70 3e 54 68 65 20 63 6f 6e 74 65 6e  >..<p>The conten
1270: 74 20 74 79 70 65 20 6f 66 20 74 68 65 20 72 65  t type of the re
1280: 70 6c 79 20 69 73 20 61 6c 77 61 79 73 20 74 68  ply is always th
1290: 65 20 73 61 6d 65 20 61 73 20 74 68 65 20 63 6f  e same as the co
12a0: 6e 74 65 6e 74 20 74 79 70 65 0a 6f 66 20 74 68  ntent type.of th
12b0: 65 20 72 65 71 75 65 73 74 2e 3c 2f 70 3e 0a 0a  e request.</p>..
12c0: 3c 68 32 3e 33 2e 30 20 46 6f 73 73 69 6c 20 53  <h2>3.0 Fossil S
12d0: 79 6e 63 68 72 6f 6e 69 7a 61 74 69 6f 6e 20 43  ynchronization C
12e0: 6f 6e 74 65 6e 74 3c 2f 68 32 3e 0a 0a 3c 70 3e  ontent</h2>..<p>
12f0: 41 20 73 79 6e 63 68 72 6f 6e 69 7a 61 74 69 6f  A synchronizatio
1300: 6e 20 72 65 71 75 65 73 74 20 62 65 74 77 65 65  n request betwee
1310: 6e 20 61 20 63 6c 69 65 6e 74 20 61 6e 64 20 73  n a client and s
1320: 65 72 76 65 72 20 63 6f 6e 73 69 73 74 73 20 6f  erver consists o
1330: 66 0a 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 48 54  f.one or more HT
1340: 54 50 20 72 65 71 75 65 73 74 73 20 61 73 20 64  TP requests as d
1350: 65 73 63 72 69 62 65 64 20 69 6e 20 74 68 65 20  escribed in the 
1360: 70 72 65 76 69 6f 75 73 20 73 65 63 74 69 6f 6e  previous section
1370: 2e 20 20 54 68 69 73 0a 73 65 63 74 69 6f 6e 20  .  This.section 
1380: 64 65 74 61 69 6c 73 20 74 68 65 20 22 78 2d 66  details the "x-f
1390: 6f 73 73 69 6c 22 20 63 6f 6e 74 65 6e 74 20 74  ossil" content t
13a0: 79 70 65 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 33 2e  ype.</p>..<h3>3.
13b0: 31 20 4c 69 6e 65 2d 6f 72 69 65 6e 74 65 64 20  1 Line-oriented 
13c0: 46 6f 72 6d 61 74 3c 2f 68 33 3e 0a 0a 3c 70 3e  Format</h3>..<p>
13d0: 54 68 65 20 78 2d 66 6f 73 73 69 6c 20 63 6f 6e  The x-fossil con
13e0: 74 65 6e 74 20 74 79 70 65 20 63 6f 6e 73 69 73  tent type consis
13f0: 74 73 20 6f 66 20 7a 65 72 6f 20 6f 72 20 6d 6f  ts of zero or mo
1400: 72 65 20 22 63 61 72 64 73 22 2e 20 20 43 61 72  re "cards".  Car
1410: 64 73 0a 61 72 65 20 73 65 70 61 72 61 74 65 20  ds.are separate 
1420: 62 79 20 74 68 65 20 6e 65 77 6c 69 6e 65 20 63  by the newline c
1430: 68 61 72 61 63 74 65 72 20 28 22 5c 6e 22 29 2e  haracter ("\n").
1440: 20 20 4c 65 61 64 69 6e 67 20 61 6e 64 20 74 72    Leading and tr
1450: 61 69 6c 69 6e 67 0a 77 68 69 74 65 73 70 61 63  ailing.whitespac
1460: 65 20 6f 6e 20 61 20 63 61 72 64 20 69 73 20 69  e on a card is i
1470: 67 6e 6f 72 65 64 2e 20 20 42 6c 61 6e 6b 20 63  gnored.  Blank c
1480: 61 72 64 73 20 61 72 65 20 69 67 6e 6f 72 65 64  ards are ignored
1490: 2e 3c 2f 70 3e 0a 0a 3c 70 3e 45 61 63 68 20 63  .</p>..<p>Each c
14a0: 61 72 64 20 69 73 20 64 69 76 69 64 65 64 20 69  ard is divided i
14b0: 6e 74 6f 20 7a 65 72 6f 20 6f 72 20 6d 6f 72 65  nto zero or more
14c0: 20 73 70 61 63 65 20 73 65 70 61 72 61 74 65 64   space separated
14d0: 20 74 6f 6b 65 6e 73 2e 0a 54 68 65 20 66 69 72   tokens..The fir
14e0: 73 74 20 74 6f 6b 65 6e 20 6f 6e 20 65 61 63 68  st token on each
14f0: 20 63 61 72 64 20 69 73 20 74 68 65 20 6f 70 65   card is the ope
1500: 72 61 74 6f 72 2e 20 20 53 75 62 73 65 71 75 65  rator.  Subseque
1510: 6e 74 20 74 6f 6b 65 6e 73 0a 61 72 65 20 61 72  nt tokens.are ar
1520: 67 75 6d 65 6e 74 73 2e 20 20 54 68 65 20 73 65  guments.  The se
1530: 74 20 6f 66 20 6f 70 65 72 61 74 6f 72 73 20 75  t of operators u
1540: 6e 64 65 72 73 74 6f 6f 64 20 62 79 20 73 65 72  nderstood by ser
1550: 76 65 72 73 20 69 73 20 73 6c 69 67 68 74 6c 79  vers is slightly
1560: 0a 64 69 66 66 65 72 65 6e 74 20 66 72 6f 6d 20  .different from 
1570: 74 68 65 20 6f 70 65 72 61 74 6f 72 73 20 75 6e  the operators un
1580: 64 65 72 73 74 6f 6f 64 20 62 79 20 63 6c 69 65  derstood by clie
1590: 6e 74 73 2c 20 74 68 6f 75 67 68 20 74 68 65 20  nts, though the 
15a0: 74 77 6f 0a 61 72 65 20 76 65 72 79 20 73 69 6d  two.are very sim
15b0: 69 6c 61 72 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 33  ilar.</p>..<h3>3
15c0: 2e 32 20 4c 6f 67 69 6e 20 43 61 72 64 73 3c 2f  .2 Login Cards</
15d0: 68 33 3e 0a 0a 3c 70 3e 45 76 65 72 79 20 6d 65  h3>..<p>Every me
15e0: 73 73 61 67 65 20 66 72 6f 6d 20 63 6c 69 65 6e  ssage from clien
15f0: 74 20 74 6f 20 73 65 72 76 65 72 20 62 65 67 69  t to server begi
1600: 6e 73 20 77 69 74 68 20 6f 6e 65 20 6f 72 20 6d  ns with one or m
1610: 6f 72 65 20 6c 6f 67 69 6e 0a 63 61 72 64 73 2e  ore login.cards.
1620: 20 20 45 61 63 68 20 6c 6f 67 69 6e 20 63 61 72    Each login car
1630: 64 20 68 61 73 20 74 68 65 20 66 6f 6c 6c 6f 77  d has the follow
1640: 69 6e 67 20 66 6f 72 6d 61 74 3a 3c 2f 70 3e 0a  ing format:</p>.
1650: 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62  .<blockquote>.<b
1660: 3e 6c 6f 67 69 6e 3c 2f 62 3e 20 20 3c 69 3e 75  >login</b>  <i>u
1670: 73 65 72 69 64 20 20 6e 6f 6e 63 65 20 20 73 69  serid  nonce  si
1680: 67 6e 61 74 75 72 65 3c 2f 69 3e 0a 3c 2f 62 6c  gnature</i>.</bl
1690: 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e 54 68  ockquote>..<p>Th
16a0: 65 20 75 73 65 72 69 64 20 69 73 20 74 68 65 20  e userid is the 
16b0: 6e 61 6d 65 20 6f 66 20 74 68 65 20 75 73 65 72  name of the user
16c0: 20 74 68 61 74 20 69 73 20 72 65 71 75 65 73 74   that is request
16d0: 69 6e 67 20 73 65 72 76 69 63 65 0a 66 72 6f 6d  ing service.from
16e0: 20 74 68 65 20 73 65 72 76 65 72 2e 20 20 54 68   the server.  Th
16f0: 65 20 6e 6f 6e 63 65 20 69 73 20 74 68 65 20 53  e nonce is the S
1700: 48 41 31 20 68 61 73 68 20 6f 66 20 74 68 65 20  HA1 hash of the 
1710: 72 65 6d 61 69 6e 64 65 72 20 6f 66 0a 74 68 65  remainder of.the
1720: 20 6d 65 73 73 61 67 65 20 2d 20 61 6c 6c 20 74   message - all t
1730: 65 78 74 20 74 68 61 74 20 66 6f 6c 6c 6f 77 73  ext that follows
1740: 20 74 68 65 20 6e 65 77 6c 69 6e 65 20 63 68 61   the newline cha
1750: 72 61 63 74 65 72 20 74 68 61 74 0a 74 65 72 6d  racter that.term
1760: 69 6e 61 74 65 73 20 74 68 65 20 6c 6f 67 69 6e  inates the login
1770: 20 63 61 72 64 2e 20 20 54 68 65 20 73 69 67 6e   card.  The sign
1780: 61 74 75 72 65 20 69 73 20 74 68 65 20 53 48 41  ature is the SHA
1790: 31 20 68 61 73 68 20 6f 66 0a 74 68 65 20 63 6f  1 hash of.the co
17a0: 6e 63 61 74 65 6e 61 74 69 6f 6e 20 6f 66 20 74  ncatenation of t
17b0: 68 65 20 6e 6f 6e 63 65 20 61 6e 64 20 74 68 65  he nonce and the
17c0: 20 75 73 65 72 73 20 70 61 73 73 77 6f 72 64 2e   users password.
17d0: 3c 2f 70 3e 0a 0a 3c 70 3e 46 6f 72 20 65 61 63  </p>..<p>For eac
17e0: 68 20 6c 6f 67 69 6e 20 63 61 72 64 2c 20 74 68  h login card, th
17f0: 65 20 73 65 72 76 65 72 20 6c 6f 6f 6b 73 20 75  e server looks u
1800: 70 20 74 68 65 20 75 73 65 72 20 61 6e 64 20 76  p the user and v
1810: 65 72 69 66 69 65 73 0a 74 68 61 74 20 74 68 65  erifies.that the
1820: 20 6e 6f 6e 63 65 20 6d 61 74 63 68 65 73 20 74   nonce matches t
1830: 68 65 20 53 48 41 31 20 68 61 73 68 20 6f 66 20  he SHA1 hash of 
1840: 74 68 65 20 72 65 6d 61 69 6e 64 65 72 20 6f 66  the remainder of
1850: 20 74 68 65 0a 6d 65 73 73 61 67 65 2e 20 20 49   the.message.  I
1860: 74 20 74 68 65 6e 20 63 68 65 63 6b 73 20 74 68  t then checks th
1870: 65 20 73 69 67 6e 61 74 75 72 65 20 68 61 73 68  e signature hash
1880: 20 74 6f 20 6d 61 6b 65 20 73 75 72 65 20 74 68   to make sure th
1890: 65 20 0a 73 69 67 6e 61 74 75 72 65 20 6d 61 74  e .signature mat
18a0: 63 68 65 73 2e 20 20 49 66 20 65 76 65 72 79 74  ches.  If everyt
18b0: 68 69 6e 67 0a 63 68 65 63 6b 73 20 6f 75 74 2c  hing.checks out,
18c0: 20 74 68 65 6e 20 74 68 65 20 63 6c 69 65 6e 74   then the client
18d0: 20 69 73 20 67 72 61 6e 74 65 64 20 61 6c 6c 20   is granted all 
18e0: 70 72 69 76 69 6c 65 67 65 73 20 6f 66 20 74 68  privileges of th
18f0: 65 0a 73 70 65 63 69 66 69 65 64 20 75 73 65 72  e.specified user
1900: 2e 3c 2f 70 3e 0a 0a 3c 70 3e 50 72 69 76 69 6c  .</p>..<p>Privil
1910: 65 67 65 73 20 61 72 65 20 63 75 6d 75 6c 61 74  eges are cumulat
1920: 69 76 65 2e 20 20 54 68 65 72 65 20 63 61 6e 20  ive.  There can 
1930: 62 65 20 6d 75 6c 74 69 70 6c 65 20 73 75 63 63  be multiple succ
1940: 65 73 73 66 75 6c 0a 6c 6f 67 69 6e 20 63 61 72  essful.login car
1950: 64 73 2e 20 20 54 68 65 20 73 65 73 73 69 6f 6e  ds.  The session
1960: 20 70 72 69 76 69 6c 65 67 65 73 20 61 72 65 20   privileges are 
1970: 74 68 65 20 62 69 74 2d 77 69 73 65 20 4f 52 20  the bit-wise OR 
1980: 6f 66 20 74 68 65 0a 70 72 69 76 69 6c 65 67 65  of the.privilege
1990: 73 20 6f 66 20 65 61 63 68 20 69 6e 64 69 76 69  s of each indivi
19a0: 64 75 61 6c 20 6c 6f 67 69 6e 2e 3c 2f 70 3e 0a  dual login.</p>.
19b0: 0a 3c 68 33 3e 33 2e 33 20 46 69 6c 65 20 43 61  .<h3>3.3 File Ca
19c0: 72 64 73 3c 2f 68 33 3e 0a 0a 3c 70 3e 41 72 74  rds</h3>..<p>Art
19d0: 69 66 61 63 74 73 20 61 72 65 20 74 72 61 6e 73  ifacts are trans
19e0: 66 65 72 72 65 64 20 75 73 69 6e 67 20 22 66 69  ferred using "fi
19f0: 6c 65 22 20 63 61 72 64 73 2e 20 20 28 54 68 65  le" cards.  (The
1a00: 20 6e 61 6d 65 20 22 66 69 6c 65 22 0a 63 61 72   name "file".car
1a10: 64 20 63 6f 6d 65 73 20 66 72 6f 6d 20 74 68 65  d comes from the
1a20: 20 66 61 63 74 20 74 68 61 74 20 6d 6f 73 74 20   fact that most 
1a30: 61 72 74 69 66 61 63 74 73 20 63 6f 72 72 65 73  artifacts corres
1a40: 70 6f 6e 64 20 74 6f 20 66 69 6c 65 73 2e 29 0a  pond to files.).
1a50: 46 69 6c 65 20 63 61 72 64 73 20 63 6f 6d 65 20  File cards come 
1a60: 69 6e 20 74 77 6f 20 64 69 66 66 65 72 65 6e 74  in two different
1a70: 20 66 6f 72 6d 61 74 73 20 64 65 70 65 6e 64 69   formats dependi
1a80: 6e 67 0a 6f 6e 20 77 68 65 74 68 65 72 20 74 68  ng.on whether th
1a90: 65 20 61 72 74 69 66 61 63 74 20 69 73 20 73 65  e artifact is se
1aa0: 6e 74 20 64 69 72 65 63 74 6c 79 20 6f 72 20 61  nt directly or a
1ab0: 73 20 61 20 64 65 6c 74 61 20 66 72 6f 6d 20 73  s a delta from s
1ac0: 6f 6d 65 0a 6f 74 68 65 72 20 61 72 74 69 66 61  ome.other artifa
1ad0: 63 74 2e 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71  ct.</p>..<blockq
1ae0: 75 6f 74 65 3e 0a 3c 62 3e 66 69 6c 65 3c 2f 62  uote>.<b>file</b
1af0: 3e 20 3c 69 3e 61 72 74 69 66 61 63 74 2d 69 64  > <i>artifact-id
1b00: 20 73 69 7a 65 3c 2f 69 3e 20 3c 62 3e 5c 6e 3c   size</i> <b>\n<
1b10: 2f 62 3e 20 3c 69 3e 63 6f 6e 74 65 6e 74 3c 2f  /b> <i>content</
1b20: 69 3e 3c 62 72 3e 0a 3c 62 3e 66 69 6c 65 3c 2f  i><br>.<b>file</
1b30: 62 3e 20 3c 69 3e 61 72 74 69 66 61 63 74 2d 69  b> <i>artifact-i
1b40: 64 20 64 65 6c 74 61 2d 61 72 74 69 66 61 63 74  d delta-artifact
1b50: 2d 69 64 20 73 69 7a 65 3c 2f 69 3e 20 3c 62 3e  -id size</i> <b>
1b60: 5c 6e 3c 2f 62 3e 20 3c 69 3e 63 6f 6e 74 65 6e  \n</b> <i>conten
1b70: 74 3c 2f 69 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f  t</i>.</blockquo
1b80: 74 65 3e 0a 0a 3c 70 3e 46 69 6c 65 20 63 61 72  te>..<p>File car
1b90: 64 73 20 61 72 65 20 64 69 66 66 65 72 65 6e 74  ds are different
1ba0: 20 66 72 6f 6d 20 61 6c 6c 20 6f 74 68 65 72 20   from all other 
1bb0: 63 61 72 64 73 20 69 6e 20 74 68 61 74 20 74 68  cards in that th
1bc0: 65 79 0a 66 6f 6c 6c 6f 77 65 64 20 62 79 20 69  ey.followed by i
1bd0: 6e 2d 6c 69 6e 65 20 22 70 61 79 6c 6f 61 64 22  n-line "payload"
1be0: 20 64 61 74 61 2e 20 20 54 68 65 20 63 6f 6e 74   data.  The cont
1bf0: 65 6e 74 20 6f 66 20 74 68 65 20 61 72 74 69 66  ent of the artif
1c00: 61 63 74 0a 6f 72 20 74 68 65 20 61 72 74 69 66  act.or the artif
1c10: 61 63 74 20 64 65 6c 74 61 20 63 6f 6e 73 69 73  act delta consis
1c20: 74 73 20 6f 66 20 74 68 65 20 66 69 72 73 74 20  ts of the first 
1c30: 3c 69 3e 73 69 7a 65 3c 2f 69 3e 20 62 79 74 65  <i>size</i> byte
1c40: 73 20 6f 66 20 74 68 65 0a 78 2d 66 6f 73 73 69  s of the.x-fossi
1c50: 6c 20 63 6f 6e 74 65 6e 74 20 74 68 61 74 20 69  l content that i
1c60: 6d 6d 65 64 69 61 74 65 6c 79 20 66 6f 6c 6c 6f  mmediately follo
1c70: 77 20 74 68 65 20 6e 65 77 6c 69 6e 65 20 74 68  w the newline th
1c80: 61 74 0a 74 65 72 6d 69 6e 61 74 65 73 20 74 68  at.terminates th
1c90: 65 20 66 69 6c 65 20 63 61 72 64 2e 20 20 4e 6f  e file card.  No
1ca0: 20 6f 74 68 65 72 20 63 61 72 64 73 20 68 61 76   other cards hav
1cb0: 65 20 74 68 69 73 20 63 68 61 72 61 63 74 65 72  e this character
1cc0: 69 73 74 69 63 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e  istic..</p>..<p>
1cd0: 54 68 65 20 66 69 72 73 74 20 61 72 67 75 6d 65  The first argume
1ce0: 6e 74 20 6f 66 20 61 20 66 69 6c 65 20 63 61 72  nt of a file car
1cf0: 64 20 69 73 20 74 68 65 20 49 44 20 6f 66 20 74  d is the ID of t
1d00: 68 65 20 61 72 74 69 66 61 63 74 20 74 68 61 74  he artifact that
1d10: 0a 69 73 20 62 65 69 6e 67 20 74 72 61 6e 73 66  .is being transf
1d20: 65 72 72 65 64 2e 20 20 54 68 65 20 61 72 74 69  erred.  The arti
1d30: 66 61 63 74 20 49 44 20 69 73 20 74 68 65 20 6c  fact ID is the l
1d40: 6f 77 65 72 2d 63 61 73 65 20 68 65 78 61 64 65  ower-case hexade
1d50: 63 69 6d 61 6c 0a 72 65 70 72 65 73 65 6e 74 61  cimal.representa
1d60: 74 69 6f 6e 20 6f 66 20 74 68 65 20 53 48 41 31  tion of the SHA1
1d70: 20 68 61 73 68 20 6f 66 20 74 68 65 20 61 72 74   hash of the art
1d80: 69 66 61 63 74 2e 0a 54 68 65 20 6c 61 73 74 20  ifact..The last 
1d90: 61 72 67 75 6d 65 6e 74 20 6f 66 20 74 68 65 20  argument of the 
1da0: 66 69 6c 65 20 63 61 72 64 20 69 73 20 74 68 65  file card is the
1db0: 20 6e 75 6d 62 65 72 20 6f 66 20 62 79 74 65 73   number of bytes
1dc0: 20 6f 66 0a 70 61 79 6c 6f 61 64 20 74 68 61 74   of.payload that
1dd0: 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 66 6f 6c   immediately fol
1de0: 6c 6f 77 20 74 68 65 20 66 69 6c 65 20 63 61 72  low the file car
1df0: 64 2e 20 20 49 66 20 74 68 65 20 66 69 6c 65 0a  d.  If the file.
1e00: 63 61 72 64 20 68 61 73 20 6f 6e 6c 79 20 74 77  card has only tw
1e10: 6f 20 61 72 67 75 6d 65 6e 74 73 2c 20 74 68 61  o arguments, tha
1e20: 74 20 6d 65 61 6e 73 20 74 68 65 20 70 61 79 6c  t means the payl
1e30: 6f 61 64 20 69 73 20 74 68 65 0a 63 6f 6d 70 6c  oad is the.compl
1e40: 65 74 65 20 63 6f 6e 74 65 6e 74 20 6f 66 20 74  ete content of t
1e50: 68 65 20 61 72 74 69 66 61 63 74 2e 20 20 49 66  he artifact.  If
1e60: 20 74 68 65 20 66 69 6c 65 20 63 61 72 64 20 68   the file card h
1e70: 61 73 20 74 68 72 65 65 0a 61 72 67 75 6d 65 6e  as three.argumen
1e80: 74 73 2c 20 74 68 65 6e 20 74 68 65 20 70 61 79  ts, then the pay
1e90: 6c 6f 61 64 20 69 73 20 61 20 64 65 6c 74 61 20  load is a delta 
1ea0: 61 6e 64 20 73 65 63 6f 6e 64 20 61 72 67 75 6d  and second argum
1eb0: 65 6e 74 20 69 73 0a 74 68 65 20 49 44 20 6f 66  ent is.the ID of
1ec0: 20 61 6e 6f 74 68 65 72 20 61 72 74 69 66 61 63   another artifac
1ed0: 74 20 74 68 61 74 20 69 73 20 74 68 65 20 73 6f  t that is the so
1ee0: 75 72 63 65 20 6f 66 20 74 68 65 20 64 65 6c 74  urce of the delt
1ef0: 61 2e 3c 2f 70 3e 0a 0a 3c 70 3e 46 69 6c 65 20  a.</p>..<p>File 
1f00: 63 61 72 64 73 20 61 72 65 20 73 65 6e 74 20 69  cards are sent i
1f10: 6e 20 62 6f 74 68 20 64 69 72 65 63 74 69 6f 6e  n both direction
1f20: 73 3a 20 63 6c 69 65 6e 74 20 74 6f 20 73 65 72  s: client to ser
1f30: 76 65 72 20 61 6e 64 0a 73 65 72 76 65 72 20 74  ver and.server t
1f40: 6f 20 63 6c 69 65 6e 74 2e 20 20 41 20 64 65 6c  o client.  A del
1f50: 74 61 20 6d 69 67 68 74 20 62 65 20 73 65 6e 74  ta might be sent
1f60: 20 62 65 66 6f 72 65 20 74 68 65 20 73 6f 75 72   before the sour
1f70: 63 65 20 6f 66 0a 74 68 65 20 64 65 6c 74 61 2c  ce of.the delta,
1f80: 20 73 6f 20 62 6f 74 68 20 63 6c 69 65 6e 74 20   so both client 
1f90: 61 6e 64 20 73 65 72 76 65 72 20 73 68 6f 75 6c  and server shoul
1fa0: 64 20 72 65 6d 65 6d 62 65 72 20 64 65 6c 74 61  d remember delta
1fb0: 73 0a 61 6e 64 20 62 65 20 61 62 6c 65 20 74 6f  s.and be able to
1fc0: 20 61 70 70 6c 79 20 74 68 65 6d 20 77 68 65 6e   apply them when
1fd0: 20 74 68 65 69 72 20 73 6f 75 72 63 65 20 61 72   their source ar
1fe0: 72 69 76 65 73 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e  rives.</p>..<h3>
1ff0: 33 2e 34 20 50 75 73 68 20 61 6e 64 20 50 75 6c  3.4 Push and Pul
2000: 6c 20 43 61 72 64 73 3c 2f 68 33 3e 0a 0a 3c 70  l Cards</h3>..<p
2010: 3e 41 6d 6f 6e 67 20 6f 66 20 74 68 65 20 66 69  >Among of the fi
2020: 72 73 74 20 63 61 72 64 73 20 69 6e 20 61 20 63  rst cards in a c
2030: 6c 69 65 6e 74 2d 74 6f 2d 73 65 72 76 65 72 20  lient-to-server 
2040: 6d 65 73 73 61 67 65 20 61 72 65 0a 74 68 65 20  message are.the 
2050: 70 75 73 68 20 61 6e 64 20 70 75 6c 6c 20 63 61  push and pull ca
2060: 72 64 73 2e 20 20 54 68 65 20 70 75 73 68 20 63  rds.  The push c
2070: 61 72 64 20 74 65 6c 6c 20 74 68 65 20 73 65 72  ard tell the ser
2080: 76 65 72 20 74 68 61 74 0a 74 68 65 20 63 6c 69  ver that.the cli
2090: 65 6e 74 20 69 73 20 70 75 73 68 69 6e 67 20 63  ent is pushing c
20a0: 6f 6e 74 65 6e 74 2e 20 20 54 68 65 20 70 75 6c  ontent.  The pul
20b0: 6c 20 63 61 72 64 20 74 65 6c 6c 20 74 68 65 20  l card tell the 
20c0: 73 65 72 76 65 72 0a 74 68 61 74 20 74 68 65 20  server.that the 
20d0: 63 6c 69 65 6e 74 20 77 61 6e 74 73 20 74 6f 20  client wants to 
20e0: 70 75 6c 6c 20 63 6f 6e 74 65 6e 74 2e 20 20 49  pull content.  I
20f0: 6e 20 74 68 65 20 65 76 65 6e 74 20 6f 66 20 61  n the event of a
2100: 20 73 79 6e 63 2c 0a 62 6f 74 68 20 63 61 72 64   sync,.both card
2110: 73 20 61 72 65 20 73 65 6e 74 2e 20 20 54 68 65  s are sent.  The
2120: 20 66 6f 72 6d 61 74 20 69 73 20 61 73 20 66 6f   format is as fo
2130: 6c 6c 6f 77 73 3a 3c 2f 70 3e 0a 0a 3c 62 6c 6f  llows:</p>..<blo
2140: 63 6b 71 75 6f 74 65 3e 0a 3c 62 3e 70 75 73 68  ckquote>.<b>push
2150: 3c 2f 62 3e 20 3c 69 3e 73 65 72 76 65 72 63 6f  </b> <i>serverco
2160: 64 65 20 70 72 6f 6a 65 63 74 63 6f 64 65 3c 2f  de projectcode</
2170: 69 3e 3c 62 72 3e 0a 3c 62 3e 70 75 6c 6c 3c 2f  i><br>.<b>pull</
2180: 62 3e 20 3c 69 3e 73 65 72 76 65 72 63 6f 64 65  b> <i>servercode
2190: 20 70 72 6f 6a 65 63 74 63 6f 64 65 3c 2f 69 3e   projectcode</i>
21a0: 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a  .</blockquote>..
21b0: 3c 70 3e 54 68 65 20 3c 69 3e 73 65 72 76 65 72  <p>The <i>server
21c0: 63 6f 64 65 3c 2f 69 3e 20 61 72 67 75 6d 65 6e  code</i> argumen
21d0: 74 20 69 73 20 74 68 65 20 72 65 70 6f 73 69 74  t is the reposit
21e0: 6f 72 79 20 49 44 20 66 6f 72 20 74 68 65 0a 63  ory ID for the.c
21f0: 6c 69 65 6e 74 2e 20 20 54 68 65 20 73 65 72 76  lient.  The serv
2200: 65 72 20 77 69 6c 6c 20 6f 6e 6c 79 20 61 6c 6c  er will only all
2210: 6f 77 20 74 68 65 20 74 72 61 6e 73 61 63 74 69  ow the transacti
2220: 6f 6e 20 74 6f 20 70 72 6f 63 65 65 64 0a 69 66  on to proceed.if
2230: 20 74 68 65 20 73 65 72 76 65 72 63 6f 64 65 20   the servercode 
2240: 69 73 20 64 69 66 66 65 72 65 6e 74 20 66 72 6f  is different fro
2250: 6d 20 69 74 73 20 6f 77 6e 20 73 65 72 76 65 72  m its own server
2260: 63 6f 64 65 2e 20 20 54 68 69 73 0a 70 72 65 76  code.  This.prev
2270: 65 6e 74 73 20 61 20 73 79 6e 63 2d 6c 6f 6f 70  ents a sync-loop
2280: 2e 20 20 54 68 65 20 3c 69 3e 70 72 6f 6a 65 63  .  The <i>projec
2290: 74 63 6f 64 65 3c 2f 69 3e 20 69 73 20 74 68 65  tcode</i> is the
22a0: 20 69 64 65 6e 74 69 66 69 65 72 0a 6f 66 20 74   identifier.of t
22b0: 68 65 20 73 6f 66 74 77 61 72 65 20 70 72 6f 6a  he software proj
22c0: 65 63 74 20 74 68 61 74 20 74 68 65 20 63 6c 69  ect that the cli
22d0: 65 6e 74 20 72 65 70 6f 73 69 74 6f 72 79 20 63  ent repository c
22e0: 6f 6e 74 61 69 6e 73 2e 0a 54 68 65 20 70 72 6f  ontains..The pro
22f0: 6a 65 63 74 63 6f 64 65 20 66 6f 72 20 74 68 65  jectcode for the
2300: 20 63 6c 69 65 6e 74 20 61 6e 64 20 73 65 72 76   client and serv
2310: 65 72 20 6d 75 73 74 20 6d 61 74 63 68 20 69 6e  er must match in
2320: 20 6f 72 64 65 72 0a 66 6f 72 20 74 68 65 20 74   order.for the t
2330: 72 61 6e 73 61 63 74 69 6f 6e 20 74 6f 20 70 72  ransaction to pr
2340: 6f 63 65 65 64 2e 3c 2f 70 3e 0a 0a 3c 70 3e 54  oceed.</p>..<p>T
2350: 68 65 20 73 65 72 76 65 72 20 77 69 6c 6c 20 61  he server will a
2360: 6c 73 6f 20 73 65 6e 64 20 61 20 70 75 73 68 20  lso send a push 
2370: 63 61 72 64 20 62 61 63 6b 20 74 6f 20 74 68 65  card back to the
2380: 20 63 6c 69 65 6e 74 0a 64 75 72 69 6e 67 20 61   client.during a
2390: 20 63 6c 6f 6e 65 2e 20 20 54 68 69 73 20 69 73   clone.  This is
23a0: 20 68 6f 77 20 74 68 65 20 63 6c 69 65 6e 74 20   how the client 
23b0: 64 65 74 65 72 6d 69 6e 65 73 20 77 68 61 74 20  determines what 
23c0: 70 72 6f 6a 65 63 74 0a 63 6f 64 65 20 74 6f 20  project.code to 
23d0: 70 75 74 20 69 6e 20 74 68 65 20 6e 65 77 20 72  put in the new r
23e0: 65 70 6f 73 69 74 6f 72 79 20 69 74 20 69 73 20  epository it is 
23f0: 63 6f 6e 73 74 72 75 63 74 69 6e 67 2e 3c 2f 70  constructing.</p
2400: 3e 0a 0a 3c 68 33 3e 33 2e 35 20 43 6c 6f 6e 65  >..<h3>3.5 Clone
2410: 20 43 61 72 64 73 3c 2f 68 33 3e 0a 0a 3c 70 3e   Cards</h3>..<p>
2420: 41 20 63 6c 6f 6e 65 20 63 61 72 64 20 77 6f 72  A clone card wor
2430: 6b 73 20 6c 69 6b 65 20 61 20 70 75 6c 6c 20 63  ks like a pull c
2440: 61 72 64 20 69 6e 20 74 68 61 74 20 69 74 20 69  ard in that it i
2450: 73 20 73 65 6e 74 20 66 72 6f 6d 0a 63 6c 69 65  s sent from.clie
2460: 6e 74 20 74 6f 20 73 65 72 76 65 72 20 69 6e 20  nt to server in 
2470: 6f 72 64 65 72 20 74 6f 20 74 65 6c 6c 20 74 68  order to tell th
2480: 65 20 73 65 72 76 65 72 20 74 68 61 74 20 74 68  e server that th
2490: 65 20 63 6c 69 65 6e 74 0a 77 61 6e 74 73 20 74  e client.wants t
24a0: 6f 20 70 75 6c 6c 20 63 6f 6e 74 65 6e 74 2e 20  o pull content. 
24b0: 20 42 75 74 20 75 6e 6c 69 6b 65 20 74 68 65 20   But unlike the 
24c0: 70 75 6c 6c 20 63 61 72 64 2c 20 74 68 65 20 63  pull card, the c
24d0: 6c 6f 6e 65 0a 63 61 72 64 20 68 61 73 20 6e 6f  lone.card has no
24e0: 20 61 72 67 75 6d 65 6e 74 73 2e 3c 2f 70 3e 0a   arguments.</p>.
24f0: 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62  .<blockquote>.<b
2500: 3e 63 6c 6f 6e 65 3c 2f 62 3e 0a 3c 2f 62 6c 6f  >clone</b>.</blo
2510: 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e 49 6e 20  ckquote>..<p>In 
2520: 72 65 73 70 6f 6e 73 65 20 74 6f 20 61 20 63 6c  response to a cl
2530: 6f 6e 65 20 6d 65 73 73 61 67 65 2c 20 74 68 65  one message, the
2540: 20 73 65 72 76 65 72 20 61 6c 73 6f 20 73 65 6e   server also sen
2550: 64 73 20 74 68 65 20 63 6c 69 65 6e 74 0a 61 20  ds the client.a 
2560: 70 75 73 68 20 6d 65 73 73 61 67 65 20 73 6f 20  push message so 
2570: 74 68 61 74 20 74 68 65 20 63 6c 69 65 6e 74 20  that the client 
2580: 63 61 6e 20 64 69 73 63 6f 76 65 72 20 74 68 65  can discover the
2590: 20 70 72 6f 6a 65 63 74 63 6f 64 65 20 66 6f 72   projectcode for
25a0: 0a 74 68 69 73 20 70 72 6f 6a 65 63 74 2e 3c 2f  .this project.</
25b0: 70 3e 0a 0a 3c 68 33 3e 33 2e 36 20 49 67 6f 74  p>..<h3>3.6 Igot
25c0: 20 43 61 72 64 73 3c 2f 68 33 3e 0a 0a 3c 70 3e   Cards</h3>..<p>
25d0: 41 6e 20 69 67 6f 74 20 63 61 72 64 20 63 61 6e  An igot card can
25e0: 20 62 65 20 73 65 6e 74 20 66 72 6f 6d 20 65 69   be sent from ei
25f0: 74 68 65 72 20 63 6c 69 65 6e 74 20 74 6f 20 73  ther client to s
2600: 65 72 76 65 72 20 6f 72 20 66 72 6f 6d 0a 73 65  erver or from.se
2610: 72 76 65 72 20 74 6f 20 63 6c 69 65 6e 74 20 69  rver to client i
2620: 6e 20 6f 72 64 65 72 20 74 6f 20 69 6e 64 69 63  n order to indic
2630: 61 74 65 20 74 68 61 74 20 74 68 65 20 73 65 6e  ate that the sen
2640: 64 65 72 20 68 6f 6c 64 73 20 61 20 63 6f 70 79  der holds a copy
2650: 0a 6f 66 20 61 20 70 61 72 74 69 63 75 6c 61 72  .of a particular
2660: 20 61 72 74 69 66 61 63 74 2e 20 20 54 68 65 20   artifact.  The 
2670: 66 6f 72 6d 61 74 20 69 73 3a 3c 2f 70 3e 0a 0a  format is:</p>..
2680: 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62 3e  <blockquote>.<b>
2690: 69 67 6f 74 3c 2f 62 3e 20 3c 69 3e 61 72 74 69  igot</b> <i>arti
26a0: 66 61 63 74 2d 69 64 3c 2f 69 3e 0a 3c 2f 62 6c  fact-id</i>.</bl
26b0: 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e 54 68  ockquote>..<p>Th
26c0: 65 20 61 72 67 75 6d 65 6e 74 20 6f 66 20 74 68  e argument of th
26d0: 65 20 69 67 6f 74 20 63 61 72 64 20 69 73 20 74  e igot card is t
26e0: 68 65 20 49 44 20 6f 66 20 74 68 65 20 61 72 74  he ID of the art
26f0: 69 66 61 63 74 20 74 68 61 74 0a 74 68 65 20 73  ifact that.the s
2700: 65 6e 64 65 72 20 70 6f 73 73 65 73 73 65 73 2e  ender possesses.
2710: 0a 54 68 65 20 72 65 63 65 69 76 65 72 20 6f 66  .The receiver of
2720: 20 61 6e 20 69 67 6f 74 20 63 61 72 64 20 77 69   an igot card wi
2730: 6c 6c 20 74 79 70 69 63 61 6c 6c 79 20 63 68 65  ll typically che
2740: 63 6b 20 74 6f 20 73 65 65 20 69 66 0a 69 74 20  ck to see if.it 
2750: 61 6c 73 6f 20 68 6f 6c 64 73 20 74 68 65 20 73  also holds the s
2760: 61 6d 65 20 61 72 74 69 66 61 63 74 20 61 6e 64  ame artifact and
2770: 20 69 66 20 6e 6f 74 20 69 74 20 77 69 6c 6c 20   if not it will 
2780: 72 65 71 75 65 73 74 20 74 68 65 20 61 72 74 69  request the arti
2790: 66 61 63 74 0a 75 73 69 6e 67 20 61 20 67 69 6d  fact.using a gim
27a0: 6d 65 20 63 61 72 64 20 69 6e 20 65 69 74 68 65  me card in eithe
27b0: 72 20 74 68 65 20 72 65 70 6c 79 20 6f 72 20 69  r the reply or i
27c0: 6e 20 74 68 65 20 6e 65 78 74 20 6d 65 73 73 61  n the next messa
27d0: 67 65 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 33 2e 37  ge.</p>..<h3>3.7
27e0: 20 47 69 6d 6d 65 20 43 61 72 64 73 3c 2f 68 33   Gimme Cards</h3
27f0: 3e 0a 0a 3c 70 3e 41 20 67 69 6d 6d 65 20 63 61  >..<p>A gimme ca
2800: 72 64 20 69 73 20 73 65 6e 74 20 66 72 6f 6d 20  rd is sent from 
2810: 65 69 74 68 65 72 20 63 6c 69 65 6e 74 20 74 6f  either client to
2820: 20 73 65 72 76 65 72 20 6f 72 20 66 72 6f 6d 20   server or from 
2830: 73 65 72 76 65 72 0a 74 6f 20 63 6c 69 65 6e 74  server.to client
2840: 2e 20 20 54 68 65 20 67 69 6d 6d 65 20 63 61 72  .  The gimme car
2850: 64 20 61 73 6b 73 20 74 68 65 20 72 65 63 65 69  d asks the recei
2860: 76 65 72 20 74 6f 20 73 65 6e 64 20 61 20 70 61  ver to send a pa
2870: 72 74 69 63 75 6c 61 72 0a 61 72 74 69 66 61 63  rticular.artifac
2880: 74 20 62 61 63 6b 20 74 6f 20 74 68 65 20 73 65  t back to the se
2890: 6e 64 65 72 2e 20 20 54 68 65 20 66 6f 72 6d 61  nder.  The forma
28a0: 74 20 6f 66 20 61 20 67 69 6d 6d 65 20 63 61 72  t of a gimme car
28b0: 64 20 69 73 20 74 68 69 73 3a 3c 2f 70 3e 0a 0a  d is this:</p>..
28c0: 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62 3e  <blockquote>.<b>
28d0: 67 69 6d 6d 65 3c 2f 62 3e 20 3c 69 3e 61 72 74  gimme</b> <i>art
28e0: 69 66 61 63 74 2d 69 64 3c 2f 69 3e 0a 3c 2f 62  ifact-id</i>.</b
28f0: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e 54  lockquote>..<p>T
2900: 68 65 20 61 72 67 75 6d 65 6e 74 20 74 6f 20 74  he argument to t
2910: 68 65 20 67 69 6d 6d 65 20 63 61 72 64 20 69 73  he gimme card is
2920: 20 74 68 65 20 49 44 20 6f 66 20 74 68 65 20 61   the ID of the a
2930: 72 74 69 66 61 63 74 20 74 68 61 74 0a 74 68 65  rtifact that.the
2940: 20 73 65 6e 64 65 72 20 77 61 6e 74 73 2e 20 20   sender wants.  
2950: 54 68 65 20 72 65 63 65 69 76 65 72 20 77 69 6c  The receiver wil
2960: 6c 20 74 79 70 69 63 61 6c 6c 79 20 72 65 73 70  l typically resp
2970: 6f 6e 64 20 74 6f 20 61 0a 67 69 6d 6d 65 20 63  ond to a.gimme c
2980: 61 72 64 20 62 79 20 73 65 6e 64 69 6e 67 20 61  ard by sending a
2990: 20 66 69 6c 65 20 63 61 72 64 20 69 6e 20 69 74   file card in it
29a0: 73 20 72 65 70 6c 79 20 6f 72 20 69 6e 20 74 68  s reply or in th
29b0: 65 20 6e 65 78 74 0a 6d 65 73 73 61 67 65 2e 3c  e next.message.<
29c0: 2f 70 3e 0a 0a 3c 68 33 3e 33 2e 38 20 43 6f 6f  /p>..<h3>3.8 Coo
29d0: 6b 69 65 20 43 61 72 64 73 3c 2f 68 33 3e 0a 0a  kie Cards</h3>..
29e0: 3c 70 3e 41 20 63 6f 6f 6b 69 65 20 63 61 72 64  <p>A cookie card
29f0: 20 63 61 6e 20 62 65 20 75 73 65 64 20 62 79 20   can be used by 
2a00: 61 20 73 65 72 76 65 72 20 74 6f 20 72 65 63 6f  a server to reco
2a10: 72 64 20 61 20 73 6d 61 6c 6c 20 61 6d 6f 75 6e  rd a small amoun
2a20: 74 0a 6f 66 20 73 74 61 74 65 20 69 6e 66 6f 72  t.of state infor
2a30: 6d 61 74 69 6f 6e 20 6f 6e 20 61 20 63 6c 69 65  mation on a clie
2a40: 6e 74 2e 20 20 54 68 65 20 73 65 72 76 65 72 20  nt.  The server 
2a50: 73 65 6e 64 73 20 61 20 63 6f 6f 6b 69 65 20 74  sends a cookie t
2a60: 6f 20 74 68 65 0a 63 6c 69 65 6e 74 2e 20 20 54  o the.client.  T
2a70: 68 65 20 63 6c 69 65 6e 74 20 73 65 6e 64 73 20  he client sends 
2a80: 74 68 65 20 73 61 6d 65 20 63 6f 6f 6b 69 65 20  the same cookie 
2a90: 62 61 63 6b 20 74 6f 20 74 68 65 20 73 65 72 76  back to the serv
2aa0: 65 72 20 6f 6e 0a 69 74 73 20 6e 65 78 74 20 72  er on.its next r
2ab0: 65 71 75 65 73 74 2e 20 20 54 68 65 20 63 6f 6f  equest.  The coo
2ac0: 6b 69 65 20 63 61 72 64 20 68 61 73 20 61 20 73  kie card has a s
2ad0: 69 6e 67 6c 65 20 61 72 67 75 6d 65 6e 74 20 77  ingle argument w
2ae0: 68 69 63 68 0a 69 73 20 69 74 73 20 70 61 79 6c  hich.is its payl
2af0: 6f 61 64 2e 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b  oad.</p>..<block
2b00: 71 75 6f 74 65 3e 0a 3c 62 3e 63 6f 6f 6b 69 65  quote>.<b>cookie
2b10: 3c 2f 62 3e 20 3c 69 3e 70 61 79 6c 6f 61 64 3c  </b> <i>payload<
2b20: 2f 69 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65  /i>.</blockquote
2b30: 3e 0a 0a 3c 70 3e 54 68 65 20 63 6c 69 65 6e 74  >..<p>The client
2b40: 20 69 73 20 6e 6f 74 20 72 65 71 75 69 72 65 64   is not required
2b50: 20 74 6f 20 72 65 74 75 72 6e 20 74 68 65 20 63   to return the c
2b60: 6f 6f 6b 69 65 20 74 6f 20 74 68 65 20 73 65 72  ookie to the ser
2b70: 76 65 72 20 6f 6e 0a 69 74 73 20 6e 65 78 74 20  ver on.its next 
2b80: 72 65 71 75 65 73 74 2e 20 20 4f 72 20 74 68 65  request.  Or the
2b90: 20 63 6c 69 65 6e 74 20 6d 69 67 68 74 20 73 65   client might se
2ba0: 6e 64 20 61 20 63 6f 6f 6b 69 65 20 66 72 6f 6d  nd a cookie from
2bb0: 20 61 20 64 69 66 66 65 72 65 6e 74 0a 73 65 72   a different.ser
2bc0: 76 65 72 20 6f 6e 20 74 68 65 20 6e 65 78 74 20  ver on the next 
2bd0: 72 65 71 75 65 73 74 2e 20 20 53 6f 20 74 68 65  request.  So the
2be0: 20 73 65 72 76 65 72 20 6d 75 73 74 20 6e 6f 74   server must not
2bf0: 20 64 65 70 65 6e 64 20 6f 6e 20 74 68 65 0a 63   depend on the.c
2c00: 6f 6f 6b 69 65 20 61 6e 64 20 74 68 65 20 73 65  ookie and the se
2c10: 72 76 65 72 20 6d 75 73 74 20 73 74 72 75 63 74  rver must struct
2c20: 75 72 65 20 74 68 65 20 63 6f 6f 6b 69 65 20 70  ure the cookie p
2c30: 61 79 6c 6f 61 64 20 69 6e 20 73 75 63 68 0a 61  ayload in such.a
2c40: 20 77 61 79 20 74 68 61 74 20 69 74 20 63 61 6e   way that it can
2c50: 20 74 65 6c 6c 20 69 66 20 74 68 65 20 63 6f 6f   tell if the coo
2c60: 6b 69 65 20 69 74 20 73 65 65 73 20 69 73 20 69  kie it sees is i
2c70: 74 73 20 6f 77 6e 20 63 6f 6f 6b 69 65 20 6f 72  ts own cookie or
2c80: 0a 61 20 63 6f 6f 6b 69 65 20 66 72 6f 6d 20 61  .a cookie from a
2c90: 6e 6f 74 68 65 72 20 73 65 72 76 65 72 2e 20 20  nother server.  
2ca0: 28 54 79 70 69 63 61 6c 6c 79 20 74 68 65 20 73  (Typically the s
2cb0: 65 72 76 65 72 20 77 69 6c 6c 20 65 6d 62 65 64  erver will embed
2cc0: 0a 69 74 73 20 73 65 72 76 65 72 63 6f 64 65 20  .its servercode 
2cd0: 61 73 20 70 61 72 74 20 6f 66 20 74 68 65 20 63  as part of the c
2ce0: 6f 6f 6b 69 65 2e 29 3c 2f 70 3e 0a 0a 3c 68 33  ookie.)</p>..<h3
2cf0: 3e 33 2e 39 20 52 65 71 75 65 73 74 2d 43 6f 6e  >3.9 Request-Con
2d00: 66 69 67 75 72 61 74 69 6f 6e 20 43 61 72 64 73  figuration Cards
2d10: 3c 2f 68 33 3e 0a 0a 3c 69 3e 54 42 44 2e 2e 2e  </h3>..<i>TBD...
2d20: 3c 2f 69 3e 0a 0a 3c 68 33 3e 33 2e 31 30 20 43  </i>..<h3>3.10 C
2d30: 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 43 61 72  onfiguration Car
2d40: 64 73 3c 2f 68 33 3e 0a 0a 3c 69 3e 54 42 44 2e  ds</h3>..<i>TBD.
2d50: 2e 2e 3c 2f 69 3e 0a 0a 3c 68 33 3e 33 2e 31 31  ..</i>..<h3>3.11
2d60: 20 45 72 72 6f 72 20 43 61 72 64 73 3c 2f 68 33   Error Cards</h3
2d70: 3e 0a 0a 3c 70 3e 49 66 20 74 68 65 20 73 65 72  >..<p>If the ser
2d80: 76 65 72 20 64 69 73 63 6f 76 65 72 73 20 61 6e  ver discovers an
2d90: 79 74 68 69 6e 67 20 77 72 6f 6e 67 20 77 69 74  ything wrong wit
2da0: 68 20 61 20 72 65 71 75 65 73 74 2c 20 69 74 20  h a request, it 
2db0: 67 65 6e 65 72 61 74 65 73 0a 61 6e 20 65 72 72  generates.an err
2dc0: 6f 72 20 63 61 72 64 20 69 6e 20 69 74 73 20 72  or card in its r
2dd0: 65 70 6c 79 2e 20 20 57 68 65 6e 20 74 68 65 20  eply.  When the 
2de0: 63 6c 69 65 6e 74 20 73 65 65 73 20 74 68 65 20  client sees the 
2df0: 65 72 72 6f 72 20 63 61 72 64 2c 0a 69 74 20 64  error card,.it d
2e00: 69 73 70 6c 61 79 73 20 61 6e 20 65 72 72 6f 72  isplays an error
2e10: 20 6d 65 73 73 61 67 65 20 74 6f 20 74 68 65 20   message to the 
2e20: 75 73 65 72 20 61 6e 64 20 61 62 6f 72 74 73 20  user and aborts 
2e30: 74 68 65 20 73 79 6e 63 0a 6f 70 65 72 61 74 69  the sync.operati
2e40: 6f 6e 2e 20 20 41 6e 20 65 72 72 6f 72 20 63 61  on.  An error ca
2e50: 72 64 20 6c 6f 6f 6b 73 20 6c 69 6b 65 20 74 68  rd looks like th
2e60: 69 73 3a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71  is:</p>..<blockq
2e70: 75 6f 74 65 3e 0a 3c 62 3e 65 72 72 6f 72 3c 2f  uote>.<b>error</
2e80: 62 3e 20 3c 69 3e 65 72 72 6f 72 2d 6d 65 73 73  b> <i>error-mess
2e90: 61 67 65 3c 2f 69 3e 0a 3c 2f 62 6c 6f 63 6b 71  age</i>.</blockq
2ea0: 75 6f 74 65 3e 0a 0a 3c 70 3e 54 68 65 20 65 72  uote>..<p>The er
2eb0: 72 6f 72 20 6d 65 73 73 61 67 65 20 69 73 20 45  ror message is E
2ec0: 6e 67 6c 69 73 68 20 74 65 78 74 20 74 68 61 74  nglish text that
2ed0: 20 69 73 20 65 6e 63 6f 64 65 64 20 69 6e 20 6f   is encoded in o
2ee0: 72 64 65 72 20 74 6f 0a 62 65 20 61 20 73 69 6e  rder to.be a sin
2ef0: 67 6c 65 20 74 6f 6b 65 6e 2e 0a 41 20 73 70 61  gle token..A spa
2f00: 63 65 20 28 41 53 43 49 49 20 30 78 32 30 29 20  ce (ASCII 0x20) 
2f10: 69 73 20 72 65 70 72 65 73 65 6e 74 65 64 20 61  is represented a
2f20: 73 20 22 5c 73 22 20 28 41 53 43 49 49 20 30 78  s "\s" (ASCII 0x
2f30: 35 43 2c 20 30 78 37 33 29 2e 20 20 41 0a 6e 65  5C, 0x73).  A.ne
2f40: 77 6c 69 6e 65 20 28 41 53 43 49 49 20 30 78 30  wline (ASCII 0x0
2f50: 61 29 20 69 73 20 22 5c 6e 22 20 28 41 53 43 49  a) is "\n" (ASCI
2f60: 49 20 30 78 36 43 2c 20 78 36 45 29 2e 20 20 41  I 0x6C, x6E).  A
2f70: 20 62 61 63 6b 73 6c 61 73 68 20 0a 28 41 53 43   backslash .(ASC
2f80: 49 49 20 30 78 35 43 29 20 69 73 20 72 65 70 72  II 0x5C) is repr
2f90: 65 73 65 6e 74 65 64 20 61 73 20 74 77 6f 20 62  esented as two b
2fa0: 61 63 6b 73 6c 61 73 68 65 73 20 22 5c 5c 22 2e  ackslashes "\\".
2fb0: 20 20 41 70 61 72 74 20 66 72 6f 6d 0a 73 70 61    Apart from.spa
2fc0: 63 65 20 61 6e 64 20 6e 65 77 6c 69 6e 65 2c 20  ce and newline, 
2fd0: 6e 6f 20 6f 74 68 65 72 20 77 68 69 74 65 73 70  no other whitesp
2fe0: 61 63 65 20 63 68 61 72 61 63 74 65 72 73 20 6e  ace characters n
2ff0: 6f 72 20 61 6e 79 0a 75 6e 70 72 69 6e 74 61 62  or any.unprintab
3000: 6c 65 20 63 68 61 72 61 63 74 65 72 73 20 61 72  le characters ar
3010: 65 20 61 6c 6c 6f 77 65 64 20 69 6e 0a 74 68 65  e allowed in.the
3020: 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65 2e 3c   error message.<
3030: 2f 70 3e 0a 0a 3c 68 33 3e 33 2e 31 32 20 43 6f  /p>..<h3>3.12 Co
3040: 6d 6d 65 6e 74 20 43 61 72 64 73 3c 2f 68 33 3e  mment Cards</h3>
3050: 0a 0a 3c 70 3e 41 6e 79 20 63 61 72 64 20 74 68  ..<p>Any card th
3060: 61 74 20 62 65 67 69 6e 73 20 77 69 74 68 20 22  at begins with "
3070: 23 22 20 28 41 53 43 49 49 20 30 78 32 33 29 20  #" (ASCII 0x23) 
3080: 69 73 20 61 20 63 6f 6d 6d 65 6e 74 20 63 61 72  is a comment car
3090: 64 20 61 6e 64 0a 69 73 20 73 69 6c 65 6e 74 6c  d and.is silentl
30a0: 79 20 69 67 6e 6f 72 65 64 2e 3c 2f 70 3e 0a 0a  y ignored.</p>..
30b0: 3c 68 33 3e 33 2e 31 33 20 55 6e 6b 6e 6f 77 6e  <h3>3.13 Unknown
30c0: 20 43 61 72 64 73 3c 2f 68 33 3e 0a 0a 3c 70 3e   Cards</h3>..<p>
30d0: 49 66 20 65 69 74 68 65 72 20 74 68 65 20 63 6c  If either the cl
30e0: 69 65 6e 74 20 6f 72 20 74 68 65 20 73 65 72 76  ient or the serv
30f0: 65 72 20 73 65 65 73 20 61 20 63 61 72 64 20 74  er sees a card t
3100: 68 61 74 20 69 73 20 6e 6f 74 0a 64 65 73 63 72  hat is not.descr
3110: 69 62 65 64 20 61 62 6f 76 65 2c 20 74 68 65 6e  ibed above, then
3120: 20 69 74 20 67 65 6e 65 72 61 74 65 73 20 61 6e   it generates an
3130: 20 65 72 72 6f 72 20 61 6e 64 20 61 62 6f 72 74   error and abort
3140: 73 2e 3c 2f 70 3e 0a 0a 3c 68 32 3e 34 2e 30 20  s.</p>..<h2>4.0 
3150: 50 68 61 6e 74 6f 6d 73 20 41 6e 64 20 43 6c 75  Phantoms And Clu
3160: 73 74 65 72 73 3c 2f 68 32 3e 0a 0a 3c 70 3e 57  sters</h2>..<p>W
3170: 68 65 6e 20 61 20 72 65 70 6f 73 69 74 6f 72 79  hen a repository
3180: 20 6b 6e 6f 77 73 20 74 68 61 74 20 61 20 61 72   knows that a ar
3190: 74 69 66 61 63 74 20 65 78 69 73 74 73 20 61 6e  tifact exists an
31a0: 64 20 6b 6e 6f 77 73 20 74 68 65 20 49 44 20 6f  d knows the ID o
31b0: 66 0a 74 68 61 74 20 61 72 74 69 66 61 63 74 2c  f.that artifact,
31c0: 20 62 75 74 20 69 74 20 64 6f 65 73 20 6e 6f 74   but it does not
31d0: 20 6b 6e 6f 77 20 74 68 65 20 61 72 74 69 66 61   know the artifa
31e0: 63 74 20 63 6f 6e 74 65 6e 74 2c 20 74 68 65 6e  ct content, then
31f0: 20 69 74 20 73 74 6f 72 65 73 20 74 68 61 74 0a   it stores that.
3200: 61 72 74 69 66 61 63 74 20 61 73 20 61 20 22 70  artifact as a "p
3210: 68 61 6e 74 6f 6d 22 2e 20 20 41 20 72 65 70 6f  hantom".  A repo
3220: 73 69 74 6f 72 79 20 77 69 6c 6c 20 74 79 70 69  sitory will typi
3230: 63 61 6c 6c 79 20 63 72 65 61 74 65 20 61 20 70  cally create a p
3240: 68 61 6e 74 6f 6d 20 77 68 65 6e 0a 69 74 20 72  hantom when.it r
3250: 65 63 65 69 76 65 73 20 61 6e 20 69 67 6f 74 20  eceives an igot 
3260: 63 61 72 64 20 66 6f 72 20 61 20 61 72 74 69 66  card for a artif
3270: 61 63 74 20 74 68 61 74 20 69 74 20 64 6f 65 73  act that it does
3280: 20 6e 6f 74 20 68 6f 6c 64 20 6f 72 20 77 68 65   not hold or whe
3290: 6e 20 69 74 0a 72 65 63 65 69 76 65 73 20 61 20  n it.receives a 
32a0: 66 69 6c 65 20 63 61 72 64 20 74 68 61 74 20 72  file card that r
32b0: 65 66 65 72 65 6e 63 65 73 20 61 20 64 65 6c 74  eferences a delt
32c0: 61 20 73 6f 75 72 63 65 20 74 68 61 74 20 69 74  a source that it
32d0: 20 64 6f 65 73 20 6e 6f 74 0a 68 6f 6c 64 2e 20   does not.hold. 
32e0: 20 57 68 65 6e 20 61 20 73 65 72 76 65 72 20 69   When a server i
32f0: 73 20 67 65 6e 65 72 61 74 69 6e 67 20 69 74 73  s generating its
3300: 20 72 65 70 6c 79 20 6f 72 20 77 68 65 6e 20 61   reply or when a
3310: 20 63 6c 69 65 6e 74 20 69 73 0a 67 65 6e 65 72   client is.gener
3320: 61 74 69 6e 67 20 61 20 6e 65 77 20 72 65 71 75  ating a new requ
3330: 65 73 74 2c 20 69 74 20 77 69 6c 6c 20 75 73 75  est, it will usu
3340: 61 6c 6c 79 20 73 65 6e 64 20 67 69 6d 6d 65 20  ally send gimme 
3350: 63 61 72 64 73 20 66 6f 72 20 65 76 65 72 79 0a  cards for every.
3360: 70 68 61 6e 74 6f 6d 20 74 68 61 74 20 69 74 20  phantom that it 
3370: 68 6f 6c 64 73 2e 3c 2f 70 3e 0a 0a 3c 70 3e 41  holds.</p>..<p>A
3380: 20 63 6c 75 73 74 65 72 20 69 73 20 61 20 73 70   cluster is a sp
3390: 65 63 69 61 6c 20 61 72 74 69 66 61 63 74 20 74  ecial artifact t
33a0: 68 61 74 20 74 65 6c 6c 73 20 6f 66 20 74 68 65  hat tells of the
33b0: 20 65 78 69 73 74 65 6e 63 65 20 6f 66 20 6f 74   existence of ot
33c0: 68 65 72 0a 61 72 74 69 66 61 63 74 73 2e 20 20  her.artifacts.  
33d0: 41 6e 79 20 61 72 74 69 66 61 63 74 20 69 6e 20  Any artifact in 
33e0: 74 68 65 20 72 65 70 6f 73 69 74 6f 72 79 20 74  the repository t
33f0: 68 61 74 20 66 6f 6c 6c 6f 77 73 20 74 68 65 20  hat follows the 
3400: 73 79 6e 74 61 63 74 69 63 20 72 75 6c 65 73 0a  syntactic rules.
3410: 6f 66 20 61 20 63 6c 75 73 74 65 72 20 69 73 20  of a cluster is 
3420: 63 6f 6e 73 69 64 65 72 65 64 20 61 20 63 6c 75  considered a clu
3430: 73 74 65 72 2e 3c 2f 70 3e 0a 0a 3c 70 3e 41 20  ster.</p>..<p>A 
3440: 63 6c 75 73 74 65 72 20 69 73 20 6c 69 6e 65 20  cluster is line 
3450: 6f 72 69 65 6e 74 65 64 2e 20 20 45 61 63 68 20  oriented.  Each 
3460: 6c 69 6e 65 20 6f 66 20 61 20 63 6c 75 73 74 65  line of a cluste
3470: 72 0a 69 73 20 61 20 63 61 72 64 2e 20 20 54 68  r.is a card.  Th
3480: 65 20 63 61 72 64 73 20 61 72 65 20 73 65 70 61  e cards are sepa
3490: 72 61 74 65 64 20 62 79 20 74 68 65 20 6e 65 77  rated by the new
34a0: 6c 69 6e 65 20 28 22 5c 6e 22 29 20 63 68 61 72  line ("\n") char
34b0: 61 63 74 65 72 2e 0a 45 61 63 68 20 63 61 72 64  acter..Each card
34c0: 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 61 20 73   consists of a s
34d0: 69 6e 67 6c 65 20 63 68 61 72 61 63 74 65 72 20  ingle character 
34e0: 63 61 72 64 20 74 79 70 65 2c 20 61 20 73 70 61  card type, a spa
34f0: 63 65 2c 20 61 6e 64 20 61 0a 73 69 6e 67 6c 65  ce, and a.single
3500: 20 61 72 67 75 6d 65 6e 74 2e 20 20 4e 6f 20 65   argument.  No e
3510: 78 74 72 61 20 77 68 69 74 65 73 70 61 63 65 20  xtra whitespace 
3520: 61 6e 64 20 6e 6f 20 74 72 61 69 6c 69 6e 67 20  and no trailing 
3530: 6f 72 20 6c 65 61 64 69 6e 67 0a 77 68 69 74 65  or leading.white
3540: 73 70 61 63 65 20 69 73 20 61 6c 6c 6f 77 65 64  space is allowed
3550: 2e 20 20 41 6c 6c 20 63 61 72 64 73 20 69 6e 20  .  All cards in 
3560: 74 68 65 20 63 6c 75 73 74 65 72 20 6d 75 73 74  the cluster must
3570: 20 6f 63 63 75 72 20 69 6e 0a 73 74 72 69 63 74   occur in.strict
3580: 20 6c 65 78 69 63 6f 67 72 61 70 68 69 63 61 6c   lexicographical
3590: 20 6f 72 64 65 72 2e 3c 2f 70 3e 0a 0a 3c 70 3e   order.</p>..<p>
35a0: 41 20 63 6c 75 73 74 65 72 20 63 6f 6e 73 69 73  A cluster consis
35b0: 74 73 20 6f 66 20 6f 6e 65 20 6f 72 20 6d 6f 72  ts of one or mor
35c0: 65 20 22 4d 22 20 63 61 72 64 73 20 66 6f 6c 6c  e "M" cards foll
35d0: 6f 77 65 64 20 62 79 20 61 20 73 69 6e 67 6c 65  owed by a single
35e0: 0a 22 5a 22 20 63 61 72 64 2e 20 20 45 61 63 68  ."Z" card.  Each
35f0: 20 4d 20 63 61 72 64 20 68 6f 6c 64 73 20 61 6e   M card holds an
3600: 20 61 72 67 75 6d 65 6e 74 20 77 68 69 63 68 20   argument which 
3610: 69 73 20 61 20 61 72 74 69 66 61 63 74 20 49 44  is a artifact ID
3620: 20 66 6f 72 20 61 6e 0a 61 72 74 69 66 61 63 74   for an.artifact
3630: 20 69 6e 20 74 68 65 20 72 65 70 6f 73 69 74 6f   in the reposito
3640: 72 79 2e 20 20 54 68 65 20 5a 20 63 61 72 64 20  ry.  The Z card 
3650: 68 61 73 20 61 20 73 69 6e 67 6c 65 20 61 72 67  has a single arg
3660: 75 6d 65 6e 74 20 77 68 69 63 68 20 69 73 20 74  ument which is t
3670: 68 65 0a 6c 6f 77 65 72 2d 63 61 73 65 20 68 65  he.lower-case he
3680: 78 61 64 65 63 69 6d 61 6c 20 72 65 70 72 65 73  xadecimal repres
3690: 65 6e 74 61 74 69 6f 6e 20 6f 66 20 74 68 65 20  entation of the 
36a0: 4d 44 35 20 63 68 65 63 6b 73 75 6d 20 6f 66 20  MD5 checksum of 
36b0: 61 6c 6c 0a 70 72 65 63 65 64 69 6e 67 20 4d 20  all.preceding M 
36c0: 63 61 72 64 73 20 75 70 20 74 6f 20 61 6e 64 20  cards up to and 
36d0: 69 6e 63 6c 75 64 65 64 20 74 68 65 20 6e 65 77  included the new
36e0: 6c 69 6e 65 20 63 68 61 72 61 63 74 65 72 20 74  line character t
36f0: 68 61 74 0a 6f 63 63 75 72 72 65 64 20 6a 75 73  hat.occurred jus
3700: 74 20 62 65 66 6f 72 65 20 74 68 65 20 5a 20 74  t before the Z t
3710: 68 61 74 20 73 74 61 72 74 73 20 74 68 65 20 5a  hat starts the Z
3720: 20 63 61 72 64 2e 3c 2f 70 3e 0a 0a 3c 70 3e 41   card.</p>..<p>A
3730: 6e 79 20 61 72 74 69 66 61 63 74 20 74 68 61 74  ny artifact that
3740: 20 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20   does not match 
3750: 74 68 65 20 73 70 65 63 69 66 69 63 61 74 69 6f  the specificatio
3760: 6e 73 20 6f 66 20 61 20 63 6c 75 73 74 65 72 0a  ns of a cluster.
3770: 65 78 61 63 74 6c 79 20 69 73 20 6e 6f 74 20 61  exactly is not a
3780: 20 63 6c 75 73 74 65 72 2e 20 20 54 68 65 72 65   cluster.  There
3790: 20 6d 75 73 74 20 62 65 20 6e 6f 20 65 78 74 72   must be no extr
37a0: 61 20 77 68 69 74 65 73 70 61 63 65 20 69 6e 0a  a whitespace in.
37b0: 74 68 65 20 61 72 74 69 66 61 63 74 2e 20 20 54  the artifact.  T
37c0: 68 65 72 65 20 6d 75 73 74 20 62 65 20 6f 6e 65  here must be one
37d0: 20 6f 72 20 6d 6f 72 65 20 4d 20 63 61 72 64 73   or more M cards
37e0: 2e 20 20 54 68 65 72 65 20 6d 75 73 74 20 62 65  .  There must be
37f0: 20 61 0a 73 69 6e 67 6c 65 20 5a 20 63 61 72 64   a.single Z card
3800: 20 77 69 74 68 20 61 20 63 6f 72 72 65 63 74 20   with a correct 
3810: 4d 44 35 20 63 68 65 63 6b 73 75 6d 2e 20 20 41  MD5 checksum.  A
3820: 6e 64 20 61 6c 6c 20 63 61 72 64 73 20 6d 75 73  nd all cards mus
3830: 74 0a 62 65 20 69 6e 20 73 74 72 69 63 74 20 6c  t.be in strict l
3840: 65 78 69 63 6f 67 72 61 70 68 69 63 61 6c 20 6f  exicographical o
3850: 72 64 65 72 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 34  rder.</p>..<h3>4
3860: 2e 31 20 54 68 65 20 55 6e 63 6c 75 73 74 65 72  .1 The Uncluster
3870: 65 64 20 54 61 62 6c 65 3c 2f 68 33 3e 0a 0a 3c  ed Table</h3>..<
3880: 70 3e 45 76 65 72 79 20 72 65 70 6f 73 69 74 6f  p>Every reposito
3890: 72 79 20 6d 61 69 6e 74 61 69 6e 73 20 61 20 74  ry maintains a t
38a0: 61 62 6c 65 20 6e 61 6d 65 64 20 22 3c 62 3e 75  able named "<b>u
38b0: 6e 63 6c 75 73 74 65 72 65 64 3c 2f 62 3e 22 0a  nclustered</b>".
38c0: 77 68 69 63 68 20 72 65 63 6f 72 64 73 20 74 68  which records th
38d0: 65 20 69 64 65 6e 74 69 74 79 20 6f 66 20 65 76  e identity of ev
38e0: 65 72 79 20 61 72 74 69 66 61 63 74 20 61 6e 64  ery artifact and
38f0: 20 70 68 61 6e 74 6f 6d 20 69 74 20 68 6f 6c 64   phantom it hold
3900: 73 20 74 68 61 74 20 69 73 20 6e 6f 74 0a 6d 65  s that is not.me
3910: 6e 74 69 6f 6e 65 64 20 69 6e 20 61 20 63 6c 75  ntioned in a clu
3920: 73 74 65 72 2e 20 20 54 68 65 20 65 6e 74 72 69  ster.  The entri
3930: 65 73 20 69 6e 20 74 68 65 20 75 6e 63 6c 75 73  es in the unclus
3940: 74 65 72 65 64 20 74 61 62 6c 65 20 63 61 6e 0a  tered table can.
3950: 62 65 20 74 68 6f 75 67 68 74 20 6f 66 20 61 73  be thought of as
3960: 20 6c 65 61 76 65 73 20 6f 6e 20 61 20 74 72 65   leaves on a tre
3970: 65 20 6f 66 20 61 72 74 69 66 61 63 74 73 2e 20  e of artifacts. 
3980: 20 53 6f 6d 65 20 6f 66 20 74 68 65 20 75 6e 63   Some of the unc
3990: 6c 75 73 74 65 72 65 64 0a 61 72 74 69 66 61 63  lustered.artifac
39a0: 74 73 20 77 69 6c 6c 20 62 65 20 6f 74 68 65 72  ts will be other
39b0: 20 63 6c 75 73 74 65 72 73 2e 20 20 54 68 6f 73   clusters.  Thos
39c0: 65 20 63 6c 75 73 74 65 72 73 20 6d 61 79 20 63  e clusters may c
39d0: 6f 6e 74 61 69 6e 20 6f 74 68 65 72 20 63 6c 75  ontain other clu
39e0: 73 74 65 72 73 2c 0a 77 68 69 63 68 20 6d 69 67  sters,.which mig
39f0: 68 74 20 63 6f 6e 74 61 69 6e 20 73 74 69 6c 6c  ht contain still
3a00: 20 6d 6f 72 65 20 63 6c 75 73 74 65 72 73 2c 20   more clusters, 
3a10: 61 6e 64 20 73 6f 20 66 6f 72 74 68 2e 20 20 42  and so forth.  B
3a20: 65 67 69 6e 6e 69 6e 67 0a 77 69 74 68 20 74 68  eginning.with th
3a30: 65 20 61 72 74 69 66 61 63 74 73 20 69 6e 20 74  e artifacts in t
3a40: 68 65 20 75 6e 63 6c 75 73 74 65 72 65 64 20 74  he unclustered t
3a50: 61 62 6c 65 2c 20 6f 6e 65 20 63 61 6e 20 66 6f  able, one can fo
3a60: 6c 6c 6f 77 20 74 68 65 20 63 68 61 69 6e 0a 6f  llow the chain.o
3a70: 66 20 63 6c 75 73 74 65 72 73 20 74 6f 20 66 69  f clusters to fi
3a80: 6e 64 20 65 76 65 72 79 20 61 72 74 69 66 61 63  nd every artifac
3a90: 74 20 69 6e 20 74 68 65 20 72 65 70 6f 73 69 74  t in the reposit
3aa0: 6f 72 79 2e 3c 2f 70 3e 0a 0a 3c 68 32 3e 35 2e  ory.</p>..<h2>5.
3ab0: 30 20 53 79 6e 63 68 72 6f 6e 69 7a 61 74 69 6f  0 Synchronizatio
3ac0: 6e 20 53 74 72 61 74 65 67 69 65 73 3c 2f 68 32  n Strategies</h2
3ad0: 3e 0a 0a 3c 68 33 3e 35 2e 31 20 50 75 6c 6c 3c  >..<h3>5.1 Pull<
3ae0: 2f 68 33 3e 0a 0a 3c 70 3e 41 20 74 79 70 69 63  /h3>..<p>A typic
3af0: 61 6c 20 70 75 6c 6c 20 6f 70 65 72 61 74 69 6f  al pull operatio
3b00: 6e 20 70 72 6f 63 65 65 64 73 20 61 73 20 73 68  n proceeds as sh
3b10: 6f 77 6e 20 62 65 6c 6f 77 2e 20 20 44 65 74 61  own below.  Deta
3b20: 69 6c 73 0a 6f 66 20 74 68 65 20 61 63 74 75 61  ils.of the actua
3b30: 6c 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e  l implementation
3b40: 20 6d 61 79 20 76 65 72 79 20 73 6c 69 67 68 74   may very slight
3b50: 6c 79 20 62 75 74 20 74 68 65 20 67 69 73 74 20  ly but the gist 
3b60: 6f 66 0a 61 20 70 75 6c 6c 20 69 73 20 63 61 70  of.a pull is cap
3b70: 74 75 72 65 64 20 69 6e 20 74 68 65 20 66 6f 6c  tured in the fol
3b80: 6c 6f 77 69 6e 67 20 73 74 65 70 73 3a 3c 2f 70  lowing steps:</p
3b90: 3e 0a 0a 3c 6f 6c 3e 0a 3c 6c 69 3e 54 68 65 20  >..<ol>.<li>The 
3ba0: 63 6c 69 65 6e 74 20 73 65 6e 64 73 20 6c 6f 67  client sends log
3bb0: 69 6e 20 61 6e 64 20 70 75 6c 6c 20 63 61 72 64  in and pull card
3bc0: 73 2e 0a 3c 6c 69 3e 54 68 65 20 63 6c 69 65 6e  s..<li>The clien
3bd0: 74 20 73 65 6e 64 73 20 61 20 63 6f 6f 6b 69 65  t sends a cookie
3be0: 20 63 61 72 64 20 69 66 20 69 74 20 68 61 73 20   card if it has 
3bf0: 70 72 65 76 69 6f 75 73 6c 79 20 72 65 63 65 69  previously recei
3c00: 76 65 64 20 61 20 63 6f 6f 6b 69 65 2e 0a 3c 6c  ved a cookie..<l
3c10: 69 3e 54 68 65 20 63 6c 69 65 6e 74 20 73 65 6e  i>The client sen
3c20: 64 73 20 67 69 6d 6d 65 20 63 61 72 64 73 20 66  ds gimme cards f
3c30: 6f 72 20 65 76 65 72 79 20 70 68 61 6e 74 6f 6d  or every phantom
3c40: 20 74 68 61 74 20 69 74 20 68 6f 6c 64 73 2e 0a   that it holds..
3c50: 3c 68 72 3e 0a 3c 6c 69 3e 54 68 65 20 73 65 72  <hr>.<li>The ser
3c60: 76 65 72 20 63 68 65 63 6b 73 20 74 68 65 20 6c  ver checks the l
3c70: 6f 67 69 6e 20 70 61 73 73 77 6f 72 64 20 61 6e  ogin password an
3c80: 64 20 72 65 6a 65 63 74 73 20 74 68 65 20 73 65  d rejects the se
3c90: 73 73 69 6f 6e 20 69 66 0a 74 68 65 20 75 73 65  ssion if.the use
3ca0: 72 20 64 6f 65 73 20 6e 6f 74 20 68 61 76 65 20  r does not have 
3cb0: 70 65 72 6d 69 73 73 69 6f 6e 20 74 6f 20 70 75  permission to pu
3cc0: 6c 6c 2e 0a 3c 6c 69 3e 49 66 20 74 68 65 20 6e  ll..<li>If the n
3cd0: 75 6d 62 65 72 20 65 6e 74 72 69 65 73 20 69 6e  umber entries in
3ce0: 20 74 68 65 20 75 6e 63 6c 75 73 74 65 72 65 64   the unclustered
3cf0: 20 74 61 62 6c 65 20 6f 6e 20 74 68 65 20 73 65   table on the se
3d00: 72 76 65 72 20 69 73 0a 67 72 65 61 74 65 72 20  rver is.greater 
3d10: 74 68 61 6e 20 31 30 30 2c 20 74 68 65 6e 20 74  than 100, then t
3d20: 68 65 20 73 65 72 76 65 72 20 63 6f 6e 73 74 72  he server constr
3d30: 75 63 74 73 20 61 20 6e 65 77 20 63 6c 75 73 74  ucts a new clust
3d40: 65 72 20 61 72 74 69 66 61 63 74 20 74 6f 0a 63  er artifact to.c
3d50: 6f 76 65 72 20 61 6c 6c 20 74 68 6f 73 65 20 75  over all those u
3d60: 6e 63 6c 75 73 74 65 72 65 64 20 65 6e 74 72 69  nclustered entri
3d70: 65 73 2e 0a 3c 6c 69 3e 54 68 65 20 73 65 72 76  es..<li>The serv
3d80: 65 72 20 73 65 6e 64 73 20 66 69 6c 65 20 63 61  er sends file ca
3d90: 72 64 73 20 66 6f 72 20 65 76 65 72 79 20 67 69  rds for every gi
3da0: 6d 6d 65 20 63 61 72 64 20 69 74 20 72 65 63 65  mme card it rece
3db0: 69 76 65 64 0a 66 72 6f 6d 20 74 68 65 20 63 6c  ived.from the cl
3dc0: 69 65 6e 74 2e 0a 3c 6c 69 3e 54 68 65 20 73 65  ient..<li>The se
3dd0: 72 76 65 72 20 73 65 6e 64 73 20 69 68 61 76 65  rver sends ihave
3de0: 20 63 61 72 64 73 20 66 6f 72 20 65 76 65 72 79   cards for every
3df0: 20 61 72 74 69 66 61 63 74 20 69 6e 20 69 74 73   artifact in its
3e00: 20 75 6e 63 6c 75 73 74 65 72 65 64 0a 74 61 62   unclustered.tab
3e10: 6c 65 20 74 68 61 74 20 69 73 20 6e 6f 74 20 61  le that is not a
3e20: 20 70 68 61 6e 74 6f 6d 2e 0a 3c 68 72 3e 0a 3c   phantom..<hr>.<
3e30: 6c 69 3e 54 68 65 20 63 6c 69 65 6e 74 20 61 64  li>The client ad
3e40: 64 73 20 74 68 65 20 63 6f 6e 74 65 6e 74 20 6f  ds the content o
3e50: 66 20 66 69 6c 65 20 63 61 72 64 73 20 74 6f 20  f file cards to 
3e60: 69 74 73 20 72 65 70 6f 73 69 74 6f 72 79 2e 0a  its repository..
3e70: 3c 6c 69 3e 54 68 65 20 63 6c 69 65 6e 74 20 63  <li>The client c
3e80: 72 65 61 74 65 73 20 61 20 70 68 61 6e 74 6f 6d  reates a phantom
3e90: 20 66 6f 72 20 65 76 65 72 79 20 69 68 61 76 65   for every ihave
3ea0: 20 63 61 72 64 20 69 6e 20 74 68 65 20 73 65 72   card in the ser
3eb0: 76 65 72 20 72 65 70 6c 79 0a 74 68 61 74 20 6d  ver reply.that m
3ec0: 65 6e 74 69 6f 6e 73 20 61 6e 20 61 72 74 69 66  entions an artif
3ed0: 61 63 74 20 74 68 61 74 20 74 68 65 20 63 6c 69  act that the cli
3ee0: 65 6e 74 20 64 6f 65 73 20 6e 6f 74 20 70 6f 73  ent does not pos
3ef0: 73 65 73 73 2e 0a 3c 6c 69 3e 54 68 65 20 63 6c  sess..<li>The cl
3f00: 69 65 6e 74 20 63 72 65 61 74 65 73 20 61 20 70  ient creates a p
3f10: 68 61 6e 74 6f 6d 20 66 6f 72 20 74 68 65 20 64  hantom for the d
3f20: 65 6c 74 61 20 73 6f 75 72 63 65 20 6f 66 20 66  elta source of f
3f30: 69 6c 65 20 63 61 72 64 73 20 77 68 65 6e 0a 74  ile cards when.t
3f40: 68 65 20 64 65 6c 74 61 20 73 6f 75 72 63 65 20  he delta source 
3f50: 69 73 20 61 6e 20 61 72 74 69 66 61 63 74 20 74  is an artifact t
3f60: 68 61 74 20 74 68 65 20 63 6c 69 65 6e 74 20 64  hat the client d
3f70: 6f 65 73 20 6e 6f 74 20 70 6f 73 73 65 73 73 2e  oes not possess.
3f80: 0a 3c 2f 6f 6c 3e 0a 0a 3c 70 3e 54 68 65 73 65  .</ol>..<p>These
3f90: 20 74 65 6e 20 73 74 65 70 73 20 72 65 70 72 65   ten steps repre
3fa0: 73 65 6e 74 20 61 20 73 69 6e 67 6c 65 20 48 54  sent a single HT
3fb0: 54 50 20 72 6f 75 6e 64 2d 74 72 69 70 20 72 65  TP round-trip re
3fc0: 71 75 65 73 74 2e 0a 54 68 65 20 66 69 72 73 74  quest..The first
3fd0: 20 74 68 72 65 65 20 73 74 65 70 73 20 61 72 65   three steps are
3fe0: 20 74 68 65 20 70 72 6f 63 65 73 73 69 6e 67 20   the processing 
3ff0: 74 68 61 74 20 6f 63 63 75 72 73 20 6f 6e 20 74  that occurs on t
4000: 68 65 20 63 6c 69 65 6e 74 0a 74 6f 20 67 65 6e  he client.to gen
4010: 65 72 61 74 65 20 74 68 65 20 72 65 71 75 65 73  erate the reques
4020: 74 2e 20 20 54 68 65 20 6d 69 64 64 6c 65 20 66  t.  The middle f
4030: 6f 75 72 20 73 74 65 70 73 20 61 72 65 20 70 72  our steps are pr
4040: 6f 63 65 73 73 69 6e 67 0a 74 68 61 74 20 6f 63  ocessing.that oc
4050: 63 75 72 73 20 6f 6e 20 74 68 65 20 73 65 72 76  curs on the serv
4060: 65 72 20 74 6f 20 69 6e 74 65 72 70 72 65 74 20  er to interpret 
4070: 74 68 65 20 72 65 71 75 65 73 74 20 61 6e 64 20  the request and 
4080: 67 65 6e 65 72 61 74 65 20 61 0a 72 65 70 6c 79  generate a.reply
4090: 2e 20 20 41 6e 64 20 74 68 65 20 6c 61 73 74 20  .  And the last 
40a0: 74 68 72 65 65 20 73 74 65 70 73 20 61 72 65 20  three steps are 
40b0: 74 68 65 20 70 72 6f 63 65 73 73 69 6e 67 20 74  the processing t
40c0: 68 61 74 20 74 68 65 0a 63 6c 69 65 6e 74 20 64  hat the.client d
40d0: 6f 65 73 20 74 6f 20 69 6e 74 65 72 70 72 65 74  oes to interpret
40e0: 20 74 68 65 20 72 65 70 6c 79 2e 3c 2f 70 3e 0a   the reply.</p>.
40f0: 0a 3c 70 3e 44 75 72 69 6e 67 20 61 20 70 75 6c  .<p>During a pul
4100: 6c 2c 20 74 68 65 20 63 6c 69 65 6e 74 20 77 69  l, the client wi
4110: 6c 6c 20 6b 65 65 70 20 73 65 6e 64 69 6e 67 20  ll keep sending 
4120: 48 54 54 50 20 72 65 71 75 65 73 74 73 0a 75 6e  HTTP requests.un
4130: 74 69 6c 20 69 74 20 68 6f 6c 64 73 20 61 6c 6c  til it holds all
4140: 20 61 72 74 69 66 61 63 74 73 20 74 68 61 74 20   artifacts that 
4150: 65 78 69 73 74 20 6f 6e 20 74 68 65 20 73 65 72  exist on the ser
4160: 76 65 72 2e 3c 2f 70 3e 0a 0a 3c 70 3e 4e 6f 74  ver.</p>..<p>Not
4170: 65 20 74 68 61 74 20 74 68 65 20 73 65 72 76 65  e that the serve
4180: 72 20 74 72 69 65 73 0a 74 6f 20 6c 69 6d 69 74  r tries.to limit
4190: 20 74 68 65 20 73 69 7a 65 20 6f 66 20 69 74 73   the size of its
41a0: 20 72 65 70 6c 79 20 6d 65 73 73 61 67 65 20 74   reply message t
41b0: 6f 20 73 6f 6d 65 74 68 69 6e 67 20 72 65 61 73  o something reas
41c0: 6f 6e 61 62 6c 65 0a 28 75 73 75 61 6c 6c 79 20  onable.(usually 
41d0: 61 62 6f 75 74 20 31 4d 42 29 20 73 6f 20 74 68  about 1MB) so th
41e0: 61 74 20 69 74 20 6d 69 67 68 74 20 73 74 6f 70  at it might stop
41f0: 20 73 65 6e 64 69 6e 67 20 66 69 6c 65 20 63 61   sending file ca
4200: 72 64 73 20 61 73 0a 64 65 73 63 72 69 62 65 64  rds as.described
4210: 20 69 6e 20 73 74 65 70 20 28 36 29 20 69 66 20   in step (6) if 
4220: 74 68 65 20 72 65 70 6c 79 20 62 65 63 6f 6d 65  the reply become
4230: 73 20 74 6f 6f 20 6c 61 72 67 65 2e 3c 2f 70 3e  s too large.</p>
4240: 0a 0a 3c 70 3e 53 74 65 70 20 28 35 29 20 69 73  ..<p>Step (5) is
4250: 20 74 68 65 20 6f 6e 6c 79 20 77 61 79 20 69 6e   the only way in
4260: 20 77 68 69 63 68 20 6e 65 77 20 63 6c 75 73 74   which new clust
4270: 65 72 73 20 63 61 6e 20 62 65 20 63 72 65 61 74  ers can be creat
4280: 65 64 2e 0a 42 79 20 6f 6e 6c 79 20 63 72 65 61  ed..By only crea
4290: 74 69 6e 67 20 63 6c 75 73 74 65 72 73 20 6f 6e  ting clusters on
42a0: 20 74 68 65 20 73 65 72 76 65 72 2c 20 77 65 20   the server, we 
42b0: 68 6f 70 65 20 74 6f 20 6d 69 6e 69 6d 69 7a 65  hope to minimize
42c0: 20 74 68 65 0a 61 6d 6f 75 6e 74 20 6f 66 20 6f   the.amount of o
42d0: 76 65 72 6c 61 70 20 62 65 74 77 65 65 6e 20 63  verlap between c
42e0: 6c 75 73 74 65 72 73 20 69 6e 20 74 68 65 20 63  lusters in the c
42f0: 6f 6d 6d 6f 6e 20 63 6f 6e 66 69 67 75 72 61 74  ommon configurat
4300: 69 6f 6e 20 77 68 65 72 65 0a 74 68 65 72 65 20  ion where.there 
4310: 69 73 20 61 20 73 69 6e 67 6c 65 20 73 65 72 76  is a single serv
4320: 65 72 20 61 6e 64 20 6d 61 6e 79 20 63 6c 69 65  er and many clie
4330: 6e 74 73 2e 20 20 54 68 65 20 73 61 6d 65 20 73  nts.  The same s
4340: 79 6e 63 68 72 6f 6e 69 7a 61 74 69 6f 6e 0a 70  ynchronization.p
4350: 72 6f 74 6f 63 6f 6c 20 77 69 6c 6c 20 63 6f 6e  rotocol will con
4360: 74 69 6e 75 65 20 74 6f 20 77 6f 72 6b 20 65 76  tinue to work ev
4370: 65 6e 20 69 66 20 74 68 65 72 65 20 61 72 65 20  en if there are 
4380: 6d 75 6c 74 69 70 6c 65 20 73 65 72 76 65 72 73  multiple servers
4390: 0a 6f 72 20 69 66 20 73 65 72 76 65 72 73 20 61  .or if servers a
43a0: 6e 64 20 63 6c 69 65 6e 74 73 20 73 6f 6d 65 74  nd clients somet
43b0: 69 6d 65 73 20 63 68 61 6e 67 65 20 72 6f 6c 65  imes change role
43c0: 73 2e 20 20 54 68 65 20 6f 6e 6c 79 20 6e 65 67  s.  The only neg
43d0: 61 74 69 76 65 0a 65 66 66 65 63 74 73 20 6f 66  ative.effects of
43e0: 20 74 68 65 73 65 20 75 6e 75 73 75 61 6c 20 61   these unusual a
43f0: 72 72 61 6e 67 65 6d 65 6e 74 73 20 69 73 20 74  rrangements is t
4400: 68 61 74 20 6d 6f 72 65 20 74 68 61 6e 20 74 68  hat more than th
4410: 65 20 6d 69 6e 69 6d 75 6d 0a 6e 75 6d 62 65 72  e minimum.number
4420: 20 6f 66 20 63 6c 75 73 74 65 72 73 20 6d 69 67   of clusters mig
4430: 68 74 20 62 65 20 67 65 6e 65 72 61 74 65 64 2e  ht be generated.
4440: 3c 2f 70 3e 0a 0a 3c 68 33 3e 35 2e 32 20 50 75  </p>..<h3>5.2 Pu
4450: 73 68 3c 2f 68 33 3e 0a 0a 3c 70 3e 41 20 74 79  sh</h3>..<p>A ty
4460: 70 69 63 61 6c 20 70 75 73 68 20 6f 70 65 72 61  pical push opera
4470: 74 69 6f 6e 20 70 72 6f 63 65 65 64 73 20 72 6f  tion proceeds ro
4480: 75 67 68 6c 79 20 61 73 20 73 68 6f 77 6e 20 62  ughly as shown b
4490: 65 6c 6f 77 2e 20 20 41 73 0a 77 69 74 68 20 61  elow.  As.with a
44a0: 20 70 75 6c 6c 2c 20 74 68 65 20 61 63 74 75 61   pull, the actua
44b0: 6c 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e  l implementation
44c0: 20 6d 61 79 20 76 61 72 79 20 73 6c 69 67 68 74   may vary slight
44d0: 6c 79 2e 3c 2f 70 3e 0a 0a 3c 6f 6c 3e 0a 3c 6c  ly.</p>..<ol>.<l
44e0: 69 3e 54 68 65 20 63 6c 69 65 6e 74 20 73 65 6e  i>The client sen
44f0: 64 73 20 6c 6f 67 69 6e 20 61 6e 64 20 70 75 73  ds login and pus
4500: 68 20 63 61 72 64 73 2e 0a 3c 6c 69 3e 54 68 65  h cards..<li>The
4510: 20 63 6c 69 65 6e 74 20 73 65 6e 64 73 20 66 69   client sends fi
4520: 6c 65 20 63 61 72 64 73 20 66 6f 72 20 61 6e 79  le cards for any
4530: 20 61 72 74 69 66 61 63 74 73 20 74 68 61 74 20   artifacts that 
4540: 69 74 20 68 6f 6c 64 73 20 74 68 61 74 20 68 61  it holds that ha
4550: 76 65 0a 6e 65 76 65 72 20 62 65 66 6f 72 65 20  ve.never before 
4560: 62 65 65 6e 20 70 75 73 68 65 64 20 2d 20 61 72  been pushed - ar
4570: 74 69 66 61 63 74 73 20 74 68 61 74 20 63 6f 6d  tifacts that com
4580: 65 20 66 72 6f 6d 20 6c 6f 63 61 6c 20 63 68 65  e from local che
4590: 63 6b 2d 69 6e 73 2e 0a 3c 6c 69 3e 49 66 20 74  ck-ins..<li>If t
45a0: 68 69 73 20 69 73 20 74 68 65 20 73 65 63 6f 6e  his is the secon
45b0: 64 20 6f 72 20 6c 61 74 65 72 20 63 79 63 6c 65  d or later cycle
45c0: 20 69 6e 20 61 20 70 75 73 68 2c 20 74 68 65 6e   in a push, then
45d0: 20 74 68 65 0a 63 6c 69 65 6e 74 20 73 65 6e 64   the.client send
45e0: 73 20 66 69 6c 65 20 63 61 72 64 73 20 66 6f 72  s file cards for
45f0: 20 61 6e 79 20 67 69 6d 6d 65 20 63 61 72 64 73   any gimme cards
4600: 20 74 68 61 74 20 74 68 65 20 73 65 72 76 65 72   that the server
4610: 20 73 65 6e 74 0a 69 6e 20 74 68 65 20 70 72 65   sent.in the pre
4620: 76 69 6f 75 73 20 63 79 63 6c 65 2e 0a 3c 6c 69  vious cycle..<li
4630: 3e 54 68 65 20 63 6c 69 65 6e 74 20 73 65 6e 64  >The client send
4640: 73 20 69 67 6f 74 20 63 61 72 64 73 20 66 6f 72  s igot cards for
4650: 20 65 76 65 72 79 20 61 72 74 69 66 61 63 74 20   every artifact 
4660: 69 6e 20 69 74 73 20 75 6e 63 6c 75 73 74 65 72  in its uncluster
4670: 65 64 20 74 61 62 6c 65 0a 74 68 61 74 20 69 73  ed table.that is
4680: 20 6e 6f 74 20 61 20 70 68 61 6e 74 6f 6d 2e 0a   not a phantom..
4690: 3c 68 72 3e 0a 3c 6c 69 3e 54 68 65 20 73 65 72  <hr>.<li>The ser
46a0: 76 65 72 20 63 68 65 63 6b 73 20 74 68 65 20 6c  ver checks the l
46b0: 6f 67 69 6e 20 61 6e 64 20 70 75 73 68 20 63 61  ogin and push ca
46c0: 72 64 73 20 61 6e 64 20 69 73 73 75 65 73 20 61  rds and issues a
46d0: 6e 20 65 72 72 6f 72 20 69 66 0a 61 6e 79 74 68  n error if.anyth
46e0: 69 6e 67 20 69 73 20 61 6d 69 73 73 2e 0a 3c 6c  ing is amiss..<l
46f0: 69 3e 54 68 65 20 73 65 72 76 65 72 20 61 63 63  i>The server acc
4700: 65 70 74 73 20 66 69 6c 65 20 63 61 72 64 73 20  epts file cards 
4710: 66 72 6f 6d 20 74 68 65 20 63 6c 69 65 6e 74 20  from the client 
4720: 61 6e 64 20 61 64 64 73 20 74 68 6f 73 65 20 61  and adds those a
4730: 72 74 69 66 61 63 74 73 0a 74 6f 20 69 74 73 20  rtifacts.to its 
4740: 72 65 70 6f 73 69 74 6f 72 79 2e 0a 3c 6c 69 3e  repository..<li>
4750: 54 68 65 20 73 65 72 76 65 72 20 63 72 65 61 74  The server creat
4760: 65 73 20 70 68 61 6e 74 6f 6d 73 20 66 6f 72 20  es phantoms for 
4770: 69 67 6f 74 20 63 61 72 64 73 20 74 68 61 74 20  igot cards that 
4780: 6d 65 6e 74 69 6f 6e 20 61 72 74 69 66 61 63 74  mention artifact
4790: 73 20 69 74 0a 64 6f 65 73 20 6e 6f 74 20 70 6f  s it.does not po
47a0: 73 73 65 73 73 20 6f 72 20 66 6f 72 20 66 69 6c  ssess or for fil
47b0: 65 20 63 61 72 64 73 20 74 68 61 74 20 6d 65 6e  e cards that men
47c0: 74 69 6f 6e 20 64 65 6c 74 61 20 73 6f 75 72 63  tion delta sourc
47d0: 65 20 61 72 74 69 66 61 63 74 73 20 74 68 61 74  e artifacts that
47e0: 0a 69 74 20 64 6f 65 73 20 6e 6f 74 20 70 6f 73  .it does not pos
47f0: 73 65 73 73 2e 0a 3c 6c 69 3e 54 68 65 20 73 65  sess..<li>The se
4800: 72 76 65 72 20 69 73 73 75 65 73 20 67 69 6d 6d  rver issues gimm
4810: 65 20 63 61 72 64 73 20 66 6f 72 20 61 6c 6c 20  e cards for all 
4820: 70 68 61 6e 74 6f 6d 73 2e 0a 3c 68 72 3e 0a 3c  phantoms..<hr>.<
4830: 6c 69 3e 54 68 65 20 63 6c 69 65 6e 74 20 72 65  li>The client re
4840: 6d 65 6d 62 65 72 73 20 74 68 65 20 67 69 6d 6d  members the gimm
4850: 65 20 63 61 72 64 73 20 66 72 6f 6d 20 74 68 65  e cards from the
4860: 20 73 65 72 76 65 72 20 73 6f 20 74 68 61 74 20   server so that 
4870: 69 74 0a 63 61 6e 20 67 65 6e 65 72 61 74 65 20  it.can generate 
4880: 66 69 6c 65 20 63 61 72 64 73 20 69 6e 20 72 65  file cards in re
4890: 70 6c 79 20 6f 6e 20 74 68 65 20 6e 65 78 74 20  ply on the next 
48a0: 63 79 63 6c 65 2e 0a 3c 2f 6f 6c 3e 0a 0a 3c 70  cycle..</ol>..<p
48b0: 3e 41 73 20 77 69 74 68 20 61 20 70 75 6c 6c 2c  >As with a pull,
48c0: 20 74 68 65 20 73 74 65 70 73 20 6f 66 20 61 20   the steps of a 
48d0: 70 75 73 68 20 6f 70 65 72 61 74 69 6f 6e 20 72  push operation r
48e0: 65 70 65 61 74 20 75 6e 74 69 6c 20 74 68 65 0a  epeat until the.
48f0: 73 65 72 76 65 72 20 6b 6e 6f 77 73 20 61 6c 6c  server knows all
4900: 20 61 72 74 69 66 61 63 74 73 20 74 68 61 74 20   artifacts that 
4910: 65 78 69 73 74 20 6f 6e 20 74 68 65 20 63 6c 69  exist on the cli
4920: 65 6e 74 2e 20 20 41 6c 73 6f 2c 20 61 73 20 77  ent.  Also, as w
4930: 69 74 68 0a 70 75 6c 6c 2c 20 74 68 65 20 63 6c  ith.pull, the cl
4940: 69 65 6e 74 20 61 74 74 65 6d 70 74 73 20 74 6f  ient attempts to
4950: 20 6b 65 65 70 20 74 68 65 20 73 69 7a 65 20 6f   keep the size o
4960: 66 20 74 68 65 20 72 65 71 75 65 73 74 20 66 72  f the request fr
4970: 6f 6d 0a 67 72 6f 77 69 6e 67 20 74 6f 6f 20 6c  om.growing too l
4980: 61 72 67 65 20 62 79 20 73 75 70 70 72 65 73 73  arge by suppress
4990: 69 6e 67 20 66 69 6c 65 20 63 61 72 64 73 20 6f  ing file cards o
49a0: 6e 63 65 20 74 68 65 0a 73 69 7a 65 20 6f 66 20  nce the.size of 
49b0: 74 68 65 20 72 65 71 75 65 73 74 20 72 65 61 63  the request reac
49c0: 68 65 73 20 31 4d 42 2e 3c 2f 70 3e 0a 0a 3c 68  hes 1MB.</p>..<h
49d0: 33 3e 35 2e 33 20 53 79 6e 63 3c 2f 68 33 3e 0a  3>5.3 Sync</h3>.
49e0: 0a 3c 70 3e 41 20 73 79 6e 63 20 69 73 20 6a 75  .<p>A sync is ju
49f0: 73 74 20 61 20 70 75 6c 6c 20 61 6e 64 20 61 20  st a pull and a 
4a00: 70 75 73 68 20 74 68 61 74 20 68 61 70 70 65 6e  push that happen
4a10: 20 61 74 20 74 68 65 20 73 61 6d 65 20 74 69 6d   at the same tim
4a20: 65 2e 0a 54 68 65 20 66 69 72 73 74 20 74 68 72  e..The first thr
4a30: 65 65 20 73 74 65 70 73 20 6f 66 20 61 20 70 75  ee steps of a pu
4a40: 6c 6c 20 61 72 65 20 63 6f 6d 62 69 6e 65 64 20  ll are combined 
4a50: 77 69 74 68 20 74 68 65 20 66 69 72 73 74 20 66  with the first f
4a60: 69 76 65 20 73 74 65 70 73 0a 6f 66 20 61 20 70  ive steps.of a p
4a70: 75 73 68 2e 20 20 53 74 65 70 73 20 28 34 29 20  ush.  Steps (4) 
4a80: 74 68 72 6f 75 67 68 20 28 37 29 20 6f 66 20 61  through (7) of a
4a90: 20 70 75 6c 6c 20 61 72 65 20 63 6f 6d 62 69 6e   pull are combin
4aa0: 65 64 20 77 69 74 68 20 73 74 65 70 73 0a 28 35  ed with steps.(5
4ab0: 29 20 74 68 72 6f 75 67 68 20 28 38 29 20 6f 66  ) through (8) of
4ac0: 20 61 20 70 75 73 68 2e 20 20 41 6e 64 20 73 74   a push.  And st
4ad0: 65 70 73 20 28 38 29 20 74 68 72 6f 75 67 68 20  eps (8) through 
4ae0: 28 31 30 29 20 6f 66 20 61 20 70 75 6c 6c 0a 61  (10) of a pull.a
4af0: 72 65 20 63 6f 6d 62 69 6e 65 64 20 77 69 74 68  re combined with
4b00: 20 73 74 65 70 20 28 39 29 20 6f 66 20 61 20 70   step (9) of a p
4b10: 75 73 68 2e 3c 2f 70 3e 0a 0a 3c 68 32 3e 36 2e  ush.</p>..<h2>6.
4b20: 30 20 53 75 6d 6d 61 72 79 3c 2f 68 32 3e 0a 0a  0 Summary</h2>..
4b30: 3c 70 3e 48 65 72 65 20 61 72 65 20 74 68 65 20  <p>Here are the 
4b40: 6b 65 79 20 70 6f 69 6e 74 73 20 6f 66 20 74 68  key points of th
4b50: 65 20 73 79 6e 63 68 72 6f 6e 69 7a 61 74 69 6f  e synchronizatio
4b60: 6e 20 70 72 6f 74 6f 63 6f 6c 3a 3c 2f 70 3e 0a  n protocol:</p>.
4b70: 0a 3c 6f 6c 3e 0a 3c 6c 69 3e 54 68 65 20 63 6c  .<ol>.<li>The cl
4b80: 69 65 6e 74 20 73 65 6e 64 73 20 6f 6e 65 20 6f  ient sends one o
4b90: 72 20 6d 6f 72 65 20 50 55 53 48 20 48 54 54 50  r more PUSH HTTP
4ba0: 20 72 65 71 75 65 73 74 73 20 74 6f 20 74 68 65   requests to the
4bb0: 20 73 65 72 76 65 72 2e 0a 20 20 20 20 54 68 65   server..    The
4bc0: 20 72 65 71 75 65 73 74 20 61 6e 64 20 72 65 70   request and rep
4bd0: 6c 79 20 63 6f 6e 74 65 6e 74 20 74 79 70 65 20  ly content type 
4be0: 69 73 20 22 61 70 70 6c 69 63 61 74 69 6f 6e 2f  is "application/
4bf0: 78 2d 66 6f 73 73 69 6c 22 2e 0a 3c 6c 69 3e 48  x-fossil"..<li>H
4c00: 54 54 50 20 72 65 71 75 65 73 74 20 63 6f 6e 74  TTP request cont
4c10: 65 6e 74 20 69 73 20 63 6f 6d 70 72 65 73 73 65  ent is compresse
4c20: 64 20 75 73 69 6e 67 20 7a 6c 69 62 2e 0a 3c 6c  d using zlib..<l
4c30: 69 3e 54 68 65 20 63 6f 6e 74 65 6e 74 20 6f 66  i>The content of
4c40: 20 72 65 71 75 65 73 74 20 61 6e 64 20 72 65 70   request and rep
4c50: 6c 79 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 63  ly consists of c
4c60: 61 72 64 73 20 77 69 74 68 20 6f 6e 65 0a 20 20  ards with one.  
4c70: 20 20 63 61 72 64 20 70 65 72 20 6c 69 6e 65 2e    card per line.
4c80: 20 20 0a 3c 6c 69 3e 43 61 72 64 20 66 6f 72 6d    .<li>Card form
4c90: 61 74 73 20 61 72 65 3a 0a 20 20 20 20 3c 75 6c  ats are:.    <ul
4ca0: 3e 0a 20 20 20 20 3c 6c 69 3e 20 3c 62 3e 6c 6f  >.    <li> <b>lo
4cb0: 67 69 6e 3c 2f 62 3e 20 3c 69 3e 75 73 65 72 69  gin</b> <i>useri
4cc0: 64 20 6e 6f 6e 63 65 20 73 69 67 6e 61 74 75 72  d nonce signatur
4cd0: 65 3c 2f 69 3e 0a 20 20 20 20 3c 6c 69 3e 20 3c  e</i>.    <li> <
4ce0: 62 3e 70 75 73 68 3c 2f 62 3e 20 3c 69 3e 73 65  b>push</b> <i>se
4cf0: 72 76 65 72 63 6f 64 65 20 70 72 6f 6a 65 63 74  rvercode project
4d00: 63 6f 64 65 3c 2f 69 3e 0a 20 20 20 20 3c 6c 69  code</i>.    <li
4d10: 3e 20 3c 62 3e 70 75 6c 6c 3c 2f 62 3e 20 3c 69  > <b>pull</b> <i
4d20: 3e 73 65 72 76 65 72 63 6f 64 65 20 70 72 6f 6a  >servercode proj
4d30: 65 63 74 63 6f 64 65 3c 2f 69 3e 0a 20 20 20 20  ectcode</i>.    
4d40: 3c 6c 69 3e 20 3c 62 3e 63 6c 6f 6e 65 3c 2f 62  <li> <b>clone</b
4d50: 3e 0a 20 20 20 20 3c 6c 69 3e 20 3c 62 3e 66 69  >.    <li> <b>fi
4d60: 6c 65 3c 2f 62 3e 20 3c 69 3e 61 72 74 69 66 61  le</b> <i>artifa
4d70: 63 74 2d 69 64 20 73 69 7a 65 3c 2f 69 3e 20 3c  ct-id size</i> <
4d80: 62 3e 5c 6e 3c 2f 62 3e 20 3c 69 3e 63 6f 6e 74  b>\n</b> <i>cont
4d90: 65 6e 74 3c 2f 69 3e 0a 20 20 20 20 3c 6c 69 3e  ent</i>.    <li>
4da0: 20 3c 62 3e 66 69 6c 65 3c 2f 62 3e 20 3c 69 3e   <b>file</b> <i>
4db0: 61 72 74 69 66 61 63 74 2d 69 64 20 64 65 6c 74  artifact-id delt
4dc0: 61 2d 61 72 74 69 66 61 63 74 2d 69 64 20 73 69  a-artifact-id si
4dd0: 7a 65 3c 2f 69 3e 20 3c 62 3e 5c 6e 3c 2f 62 3e  ze</i> <b>\n</b>
4de0: 20 3c 69 3e 63 6f 6e 74 65 6e 74 3c 2f 69 3e 0a   <i>content</i>.
4df0: 20 20 20 20 3c 6c 69 3e 20 3c 62 3e 69 67 6f 74      <li> <b>igot
4e00: 3c 2f 62 3e 20 3c 69 3e 61 72 74 69 66 61 63 74  </b> <i>artifact
4e10: 2d 69 64 3c 2f 69 3e 0a 20 20 20 20 3c 6c 69 3e  -id</i>.    <li>
4e20: 20 3c 62 3e 67 69 6d 6d 65 3c 2f 62 3e 20 3c 69   <b>gimme</b> <i
4e30: 3e 61 72 74 69 66 61 63 74 2d 69 64 3c 2f 69 3e  >artifact-id</i>
4e40: 0a 20 20 20 20 3c 6c 69 3e 20 3c 62 3e 63 6f 6f  .    <li> <b>coo
4e50: 6b 69 65 3c 2f 62 3e 20 20 3c 69 3e 63 6f 6f 6b  kie</b>  <i>cook
4e60: 69 65 2d 74 65 78 74 3c 2f 69 3e 0a 20 20 20 20  ie-text</i>.    
4e70: 3c 6c 69 3e 20 3c 62 3e 72 65 71 63 6f 6e 66 69  <li> <b>reqconfi
4e80: 67 3c 2f 62 3e 20 3c 69 3e 70 61 72 61 6d 65 74  g</b> <i>paramet
4e90: 65 72 2d 6e 61 6d 65 3c 2f 69 3e 0a 20 20 20 20  er-name</i>.    
4ea0: 3c 6c 69 3e 20 3c 62 3e 63 6f 6e 66 69 67 3c 2f  <li> <b>config</
4eb0: 62 3e 20 3c 69 3e 70 61 72 61 6d 65 74 65 72 2d  b> <i>parameter-
4ec0: 6e 61 6d 65 20 73 69 7a 65 3c 2f 69 3e 20 3c 62  name size</i> <b
4ed0: 3e 5c 6e 3c 2f 62 3e 20 3c 69 3e 63 6f 6e 74 65  >\n</b> <i>conte
4ee0: 6e 74 3c 2f 69 3e 0a 20 20 20 20 3c 6c 69 3e 20  nt</i>.    <li> 
4ef0: 3c 62 3e 23 3c 2f 62 3e 20 3c 69 3e 61 72 62 69  <b>#</b> <i>arbi
4f00: 74 72 61 72 79 2d 74 65 78 74 2e 2e 2e 3c 2f 69  trary-text...</i
4f10: 3e 0a 20 20 20 20 3c 6c 69 3e 20 3c 62 3e 65 72  >.    <li> <b>er
4f20: 72 6f 72 3c 2f 62 3e 20 3c 69 3e 65 72 72 6f 72  ror</b> <i>error
4f30: 2d 6d 65 73 73 61 67 65 3c 2f 69 3e 0a 20 20 20  -message</i>.   
4f40: 20 3c 2f 75 6c 3e 0a 3c 6c 69 3e 50 68 61 6e 74   </ul>.<li>Phant
4f50: 6f 6d 73 20 61 72 65 20 61 72 74 69 66 61 63 74  oms are artifact
4f60: 73 20 74 68 61 74 20 61 20 72 65 70 6f 73 69 74  s that a reposit
4f70: 6f 72 79 20 6b 6e 6f 77 73 20 65 78 69 73 74 20  ory knows exist 
4f80: 62 75 74 20 64 6f 65 73 20 6e 6f 74 20 70 6f 73  but does not pos
4f90: 73 65 73 73 2e 0a 3c 6c 69 3e 43 6c 75 73 74 65  sess..<li>Cluste
4fa0: 72 73 20 61 72 65 20 61 72 74 69 66 61 63 74 73  rs are artifacts
4fb0: 20 74 68 61 74 20 63 6f 6e 74 61 69 6e 20 49 44   that contain ID
4fc0: 73 20 6f 66 20 6f 74 68 65 72 20 61 72 74 69 66  s of other artif
4fd0: 61 63 74 73 2e 0a 3c 6c 69 3e 43 6c 75 73 74 65  acts..<li>Cluste
4fe0: 72 73 20 61 72 65 20 63 72 65 61 74 65 64 20 61  rs are created a
4ff0: 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 6f 6e 20  utomatically on 
5000: 74 68 65 20 73 65 72 76 65 72 20 64 75 72 69 6e  the server durin
5010: 67 20 61 20 70 75 6c 6c 2e 0a 3c 6c 69 3e 52 65  g a pull..<li>Re
5020: 70 6f 73 69 74 6f 72 69 65 73 20 6b 65 65 70 20  positories keep 
5030: 74 72 61 63 6b 20 6f 66 20 61 6c 6c 20 61 72 74  track of all art
5040: 69 66 61 63 74 73 20 74 68 61 74 20 61 72 65 20  ifacts that are 
5050: 6e 6f 74 20 6e 61 6d 65 64 20 69 6e 20 61 6e 79  not named in any
5060: 0a 63 6c 75 73 74 65 72 20 61 6e 64 20 73 65 6e  .cluster and sen
5070: 64 20 69 67 6f 74 20 6d 65 73 73 61 67 65 73 20  d igot messages 
5080: 66 6f 72 20 74 68 6f 73 65 20 61 72 74 69 66 61  for those artifa
5090: 63 74 73 2e 0a 3c 6c 69 3e 52 65 70 6f 73 69 74  cts..<li>Reposit
50a0: 6f 72 69 65 73 20 6b 65 65 70 20 74 72 61 63 6b  ories keep track
50b0: 20 6f 66 20 61 6c 6c 20 74 68 65 20 70 68 61 6e   of all the phan
50c0: 74 6f 6d 73 20 74 68 65 79 20 68 6f 6c 64 20 61  toms they hold a
50d0: 6e 64 20 73 65 6e 64 0a 67 69 6d 6d 65 20 6d 65  nd send.gimme me
50e0: 73 73 61 67 65 73 20 66 6f 72 20 74 68 6f 73 65  ssages for those
50f0: 20 61 72 74 69 66 61 63 74 73 2e 0a 3c 2f 6f 6c   artifacts..</ol
5100: 3e 0a                                            >.