Artifact 5cff62ccf6569233a0d13b2c89c2c0f86a381eaa:
File
www/sync.wiki
part of check-in
[d87ca60c58]
- initial ports of static .html to static /doc .wiki
by
stephan on
2008-05-15 20:25:46.
Also file
www/sync.wiki
part of check-in
[f94f7e5f49]
- Merge the fork back together.
by
drh on
2008-05-16 00:27:49.
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 54 .</p>..<h2>1.0 T
01b0: 72 61 6e 73 70 6f 72 74 3c 2f 68 32 3e 0a 0a 3c ransport</h2>..<
01c0: 70 3e 41 6c 6c 20 63 6f 6d 6d 75 6e 69 63 61 74 p>All communicat
01d0: 69 6f 6e 20 62 65 74 77 65 65 6e 20 63 6c 69 65 ion between clie
01e0: 6e 74 20 61 6e 64 20 73 65 72 76 65 72 20 69 73 nt and server is
01f0: 20 76 69 61 20 48 54 54 50 20 72 65 71 75 65 73 via HTTP reques
0200: 74 73 2e 0a 54 68 65 20 73 65 72 76 65 72 20 69 ts..The server i
0210: 73 20 6c 69 73 74 65 6e 69 6e 67 20 66 6f 72 20 s listening for
0220: 69 6e 63 6f 6d 69 6e 67 20 48 54 54 50 20 72 65 incoming HTTP re
0230: 71 75 65 73 74 73 2e 20 20 54 68 65 20 63 6c 69 quests. The cli
0240: 65 6e 74 0a 69 73 73 75 65 73 20 6f 6e 65 20 6f ent.issues one o
0250: 72 20 6d 6f 72 65 20 48 54 54 50 20 72 65 71 75 r more HTTP requ
0260: 65 73 74 73 20 61 6e 64 20 72 65 63 65 69 76 65 ests and receive
0270: 73 20 72 65 70 6c 69 65 73 20 66 6f 72 20 65 61 s replies for ea
0280: 63 68 0a 72 65 71 75 65 73 74 2e 3c 2f 70 3e 0a ch.request.</p>.
0290: 0a 3c 70 3e 54 68 65 20 73 65 72 76 65 72 20 6d .<p>The server m
02a0: 69 67 68 74 20 62 65 20 72 75 6e 6e 69 6e 67 20 ight be running
02b0: 61 73 20 61 6e 20 69 6e 64 65 70 65 6e 64 65 6e as an independen
02c0: 74 20 73 65 72 76 65 72 0a 75 73 69 6e 67 20 74 t server.using t
02d0: 68 65 20 3c 62 3e 73 65 72 76 65 72 3c 2f 62 3e he <b>server</b>
02e0: 20 63 6f 6d 6d 61 6e 64 2c 20 6f 72 20 69 74 20 command, or it
02f0: 6d 69 67 68 74 20 62 65 20 6c 61 75 6e 63 68 65 might be launche
0300: 64 20 66 72 6f 6d 0a 69 6e 65 74 64 20 6f 72 20 d from.inetd or
0310: 78 69 6e 65 74 64 20 75 73 69 6e 67 20 74 68 65 xinetd using the
0320: 20 3c 62 3e 68 74 74 70 3c 2f 62 3e 20 63 6f 6d <b>http</b> com
0330: 6d 61 6e 64 2e 20 20 4f 72 20 74 68 65 20 73 65 mand. Or the se
0340: 72 76 65 72 20 6d 69 67 68 74 0a 62 65 20 6c 61 rver might.be la
0350: 75 6e 63 68 65 64 20 66 72 6f 6d 20 43 47 49 2e unched from CGI.
0360: 20 20 54 68 65 20 64 65 74 61 69 6c 73 20 6f 66 The details of
0370: 20 68 6f 77 20 74 68 65 20 73 65 72 76 65 72 20 how the server
0380: 69 73 20 63 6f 6e 66 69 67 75 72 65 64 0a 74 6f is configured.to
0390: 20 22 6c 69 73 74 65 6e 22 20 66 6f 72 20 69 6e "listen" for in
03a0: 63 6f 6d 69 6e 67 20 48 54 54 50 20 72 65 71 75 coming HTTP requ
03b0: 65 73 74 73 20 69 73 20 69 6d 6d 61 74 65 72 69 ests is immateri
03c0: 61 6c 2e 20 20 54 68 65 20 69 6d 70 6f 72 74 61 al. The importa
03d0: 6e 74 0a 70 6f 69 6e 74 20 69 73 20 74 68 61 74 nt.point is that
03e0: 20 74 68 65 20 73 65 72 76 65 72 20 69 73 20 6c the server is l
03f0: 69 73 74 65 6e 69 6e 67 20 66 6f 72 20 72 65 71 istening for req
0400: 75 65 73 74 73 20 61 6e 64 20 74 68 65 20 63 6c uests and the cl
0410: 69 65 6e 74 0a 69 73 20 74 68 65 20 69 73 73 75 ient.is the issu
0420: 65 72 20 6f 66 20 74 68 65 20 72 65 71 75 65 73 er of the reques
0430: 74 73 2e 3c 2f 70 3e 0a 0a 3c 70 3e 41 20 73 69 ts.</p>..<p>A si
0440: 6e 67 6c 65 20 70 75 73 68 2c 20 70 75 6c 6c 2c ngle push, pull,
0450: 20 6f 72 20 73 79 6e 63 20 6d 69 67 68 74 20 69 or sync might i
0460: 6e 76 6f 6c 76 65 20 6d 75 6c 74 69 70 6c 65 20 nvolve multiple
0470: 48 54 54 50 20 72 65 71 75 65 73 74 73 2e 0a 54 HTTP requests..T
0480: 68 65 20 63 6c 69 65 6e 74 20 6d 61 69 6e 74 61 he client mainta
0490: 69 6e 73 20 73 74 61 74 65 20 62 65 74 77 65 65 ins state betwee
04a0: 6e 20 61 6c 6c 20 72 65 71 75 65 73 74 73 2e 20 n all requests.
04b0: 20 42 75 74 20 6f 6e 20 74 68 65 20 73 65 72 76 But on the serv
04c0: 65 72 0a 73 69 64 65 2c 20 65 61 63 68 20 72 65 er.side, each re
04d0: 71 75 65 73 74 20 69 73 20 69 6e 64 65 70 65 6e quest is indepen
04e0: 64 65 6e 74 2e 20 20 54 68 65 20 73 65 72 76 65 dent. The serve
04f0: 72 20 64 6f 65 73 20 6e 6f 74 20 70 72 65 73 65 r does not prese
0500: 72 76 65 0a 61 6e 79 20 69 6e 66 6f 72 6d 61 74 rve.any informat
0510: 69 6f 6e 20 61 62 6f 75 74 20 74 68 65 20 63 6c ion about the cl
0520: 69 65 6e 74 20 66 72 6f 6d 20 6f 6e 65 20 72 65 ient from one re
0530: 71 75 65 73 74 20 74 6f 20 74 68 65 20 6e 65 78 quest to the nex
0540: 74 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 31 2e 31 20 t.</p>..<h3>1.1
0550: 53 65 72 76 65 72 20 49 64 65 6e 74 69 66 69 63 Server Identific
0560: 61 74 69 6f 6e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 ation</h3>..<p>T
0570: 68 65 20 73 65 72 76 65 72 20 69 73 20 69 64 65 he server is ide
0580: 6e 74 69 66 69 65 64 20 62 79 20 61 20 55 52 4c ntified by a URL
0590: 20 61 72 67 75 6d 65 6e 74 20 74 68 61 74 20 61 argument that a
05a0: 63 63 6f 6d 70 61 6e 69 65 73 20 74 68 65 0a 70 ccompanies the.p
05b0: 75 73 68 2c 20 70 75 6c 6c 2c 20 6f 72 20 73 79 ush, pull, or sy
05c0: 6e 63 20 63 6f 6d 6d 61 6e 64 20 6f 6e 20 74 68 nc command on th
05d0: 65 20 63 6c 69 65 6e 74 2e 20 20 28 41 73 20 61 e client. (As a
05e0: 20 63 6f 6e 76 65 6e 69 65 6e 63 65 20 74 6f 0a convenience to.
05f0: 75 73 65 72 73 2c 20 74 68 65 20 55 52 4c 20 63 users, the URL c
0600: 61 6e 20 62 65 20 6f 6d 69 74 74 65 64 20 6f 6e an be omitted on
0610: 20 74 68 65 20 63 6c 69 65 6e 74 20 63 6f 6d 6d the client comm
0620: 61 6e 64 20 61 6e 64 20 74 68 65 20 73 61 6d 65 and and the same
0630: 20 55 52 4c 0a 66 72 6f 6d 20 74 68 65 20 6d 6f URL.from the mo
0640: 73 74 20 72 65 63 65 6e 74 20 70 75 73 68 2c 20 st recent push,
0650: 70 75 6c 6c 2c 20 6f 72 20 73 79 6e 63 20 77 69 pull, or sync wi
0660: 6c 6c 20 62 65 20 72 65 75 73 65 64 2e 20 20 54 ll be reused. T
0670: 68 69 73 20 73 61 76 65 73 0a 74 79 70 69 6e 67 his saves.typing
0680: 20 69 6e 20 74 68 65 20 63 6f 6d 6d 6f 6e 20 63 in the common c
0690: 61 73 65 20 77 68 65 72 65 20 74 68 65 20 63 6c ase where the cl
06a0: 69 65 6e 74 20 64 6f 65 73 20 6d 75 6c 74 69 70 ient does multip
06b0: 6c 65 20 73 79 6e 63 73 20 74 6f 0a 74 68 65 20 le syncs to.the
06c0: 73 61 6d 65 20 73 65 72 76 65 72 2e 29 3c 2f 70 same server.)</p
06d0: 3e 0a 0a 3c 70 3e 54 68 65 20 63 6c 69 65 6e 74 >..<p>The client
06e0: 20 6d 6f 64 69 66 69 65 73 20 74 68 65 20 55 52 modifies the UR
06f0: 4c 20 62 79 20 61 70 70 65 6e 64 69 6e 67 20 74 L by appending t
0700: 68 65 20 6d 65 74 68 6f 64 20 6e 61 6d 65 20 22 he method name "
0710: 3c 62 3e 2f 78 66 65 72 3c 2f 62 3e 22 0a 74 6f <b>/xfer</b>".to
0720: 20 74 68 65 20 65 6e 64 2e 20 20 46 6f 72 20 65 the end. For e
0730: 78 61 6d 70 6c 65 2c 20 69 66 20 74 68 65 20 55 xample, if the U
0740: 52 4c 20 73 70 65 63 69 66 69 65 64 20 6f 6e 20 RL specified on
0750: 74 68 65 20 63 6c 69 65 6e 74 20 63 6f 6d 6d 61 the client comma
0760: 6e 64 0a 6c 69 6e 65 20 69 73 3c 2f 70 3e 0a 0a nd.line is</p>..
0770: 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 68 74 74 <blockquote>.htt
0780: 70 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 68 p://fossil-scm.h
0790: 77 61 63 69 2e 63 6f 6d 2f 66 6f 73 73 69 6c 0a waci.com/fossil.
07a0: 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c </blockquote>..<
07b0: 70 3e 54 68 65 6e 20 74 68 65 20 55 52 4c 20 74 p>Then the URL t
07c0: 68 61 74 20 69 73 20 72 65 61 6c 6c 79 20 75 73 hat is really us
07d0: 65 64 20 74 6f 20 64 6f 20 74 68 65 20 73 79 6e ed to do the syn
07e0: 63 68 72 6f 6e 69 7a 61 74 69 6f 6e 20 77 69 6c chronization wil
07f0: 6c 0a 62 65 3a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 l.be:</p>..<bloc
0800: 6b 71 75 6f 74 65 3e 0a 68 74 74 70 3a 2f 2f 66 kquote>.http://f
0810: 6f 73 73 69 6c 2d 73 63 6d 2e 68 77 61 63 69 2e ossil-scm.hwaci.
0820: 63 6f 6d 2f 66 6f 73 73 69 6c 2f 78 66 65 72 0a com/fossil/xfer.
0830: 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c </blockquote>..<
0840: 68 33 3e 31 2e 32 20 48 54 54 50 20 52 65 71 75 h3>1.2 HTTP Requ
0850: 65 73 74 20 46 6f 72 6d 61 74 3c 2f 68 33 3e 0a est Format</h3>.
0860: 0a 3c 70 3e 54 68 65 20 63 6c 69 65 6e 74 20 61 .<p>The client a
0870: 6c 77 61 79 73 20 73 65 6e 64 73 20 61 20 50 4f lways sends a PO
0880: 53 54 20 72 65 71 75 65 73 74 20 74 6f 20 74 68 ST request to th
0890: 65 20 73 65 72 76 65 72 2e 20 20 54 68 65 0a 67 e server. The.g
08a0: 65 6e 65 72 61 6c 20 66 6f 72 6d 61 74 20 6f 66 eneral format of
08b0: 20 74 68 65 20 50 4f 53 54 20 72 65 71 75 65 73 the POST reques
08c0: 74 20 69 73 20 61 73 20 66 6f 6c 6c 6f 77 73 3a t is as follows:
08d0: 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 </p>..<blockquot
08e0: 65 3e 3c 70 72 65 3e 0a 50 4f 53 54 20 2f 66 6f e><pre>.POST /fo
08f0: 73 73 69 6c 2f 78 66 65 72 20 48 54 54 50 2f 31 ssil/xfer HTTP/1
0900: 2e 30 0a 48 6f 73 74 3a 20 66 6f 73 73 69 6c 2d .0.Host: fossil-
0910: 73 63 6d 2e 68 77 61 63 69 2e 63 6f 6d 3a 38 30 scm.hwaci.com:80
0920: 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 61 .Content-Type: a
0930: 70 70 6c 69 63 61 74 69 6f 6e 2f 78 2d 66 6f 73 pplication/x-fos
0940: 73 69 6c 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 sil.Content-Leng
0950: 74 68 3a 20 34 32 31 36 0a 0a 3c 69 3e 63 6f 6e th: 4216..<i>con
0960: 74 65 6e 74 2e 2e 2e 3c 2f 69 3e 0a 3c 2f 70 72 tent...</i>.</pr
0970: 65 3e 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a e></blockquote>.
0980: 0a 3c 70 3e 49 6e 20 74 68 65 20 65 78 61 6d 70 .<p>In the examp
0990: 6c 65 20 61 62 6f 76 65 2c 20 74 68 65 20 70 61 le above, the pa
09a0: 74 68 6e 61 6d 65 20 67 69 76 65 6e 20 61 66 74 thname given aft
09b0: 65 72 20 74 68 65 20 50 4f 53 54 20 6b 65 79 77 er the POST keyw
09c0: 6f 72 64 0a 6f 6e 20 74 68 65 20 66 69 72 73 74 ord.on the first
09d0: 20 6c 69 6e 65 20 69 73 20 61 20 63 6f 70 79 20 line is a copy
09e0: 6f 66 20 74 68 65 20 55 52 4c 20 70 61 74 68 6e of the URL pathn
09f0: 61 6d 65 2e 20 20 54 68 65 20 48 6f 73 74 3a 20 ame. The Host:
0a00: 70 61 72 61 6d 65 74 65 72 0a 69 73 20 61 6c 73 parameter.is als
0a10: 6f 20 74 61 6b 65 6e 20 66 72 6f 6d 20 74 68 65 o taken from the
0a20: 20 55 52 4c 2e 20 20 54 68 65 20 63 6f 6e 74 65 URL. The conte
0a30: 6e 74 20 74 79 70 65 20 69 73 20 61 6c 77 61 79 nt type is alway
0a40: 73 20 65 69 74 68 65 72 0a 22 61 70 70 6c 69 63 s either."applic
0a50: 61 74 69 6f 6e 2f 78 2d 66 6f 73 73 69 6c 22 20 ation/x-fossil"
0a60: 6f 72 20 22 61 70 70 6c 69 63 61 74 69 6f 6e 2f or "application/
0a70: 78 2d 66 6f 73 73 69 6c 2d 64 65 62 75 67 22 2e x-fossil-debug".
0a80: 20 20 54 68 65 20 22 78 2d 66 6f 73 73 69 6c 22 The "x-fossil"
0a90: 0a 63 6f 6e 74 65 6e 74 20 74 79 70 65 20 69 73 .content type is
0aa0: 20 74 68 65 20 64 65 66 61 75 6c 74 2e 20 20 54 the default. T
0ab0: 68 65 20 6f 6e 6c 79 20 64 69 66 66 65 72 65 6e he only differen
0ac0: 63 65 20 69 73 20 74 68 61 74 20 22 78 2d 66 6f ce is that "x-fo
0ad0: 73 73 69 6c 22 0a 63 6f 6e 74 65 6e 74 20 69 73 ssil".content is
0ae0: 20 63 6f 6d 70 72 65 73 73 65 64 20 75 73 69 6e compressed usin
0af0: 67 20 7a 6c 69 62 20 77 68 65 72 65 61 73 20 22 g zlib whereas "
0b00: 78 2d 66 6f 73 73 69 6c 2d 64 65 62 75 67 22 20 x-fossil-debug"
0b10: 69 73 20 73 65 6e 74 0a 75 6e 63 6f 6d 70 72 65 is sent.uncompre
0b20: 73 73 65 64 2e 3c 2f 70 3e 0a 0a 3c 70 3e 41 20 ssed.</p>..<p>A
0b30: 74 79 70 69 63 61 6c 20 72 65 70 6c 79 20 66 72 typical reply fr
0b40: 6f 6d 20 74 68 65 20 73 65 72 76 65 72 20 6d 69 om the server mi
0b50: 67 68 74 20 6c 6f 6f 6b 20 73 6f 6d 65 74 68 69 ght look somethi
0b60: 6e 67 20 6c 69 6b 65 20 74 68 69 73 3a 3c 2f 70 ng like this:</p
0b70: 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 3c >..<blockquote><
0b80: 70 72 65 3e 0a 48 54 54 50 2f 31 2e 30 20 32 30 pre>.HTTP/1.0 20
0b90: 30 20 4f 4b 0a 44 61 74 65 3a 20 4d 6f 6e 2c 20 0 OK.Date: Mon,
0ba0: 31 30 20 53 65 70 20 32 30 30 37 20 31 32 3a 32 10 Sep 2007 12:2
0bb0: 31 3a 30 31 20 47 4d 54 0a 43 6f 6e 6e 65 63 74 1:01 GMT.Connect
0bc0: 69 6f 6e 3a 20 63 6c 6f 73 65 0a 43 61 63 68 65 ion: close.Cache
0bd0: 2d 63 6f 6e 74 72 6f 6c 3a 20 70 72 69 76 61 74 -control: privat
0be0: 65 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 e.Content-Type:
0bf0: 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 2d 66 6f application/x-fo
0c00: 73 73 69 6c 3b 20 63 68 61 72 73 65 74 3d 55 53 ssil; charset=US
0c10: 2d 41 53 43 49 49 0a 43 6f 6e 74 65 6e 74 2d 4c -ASCII.Content-L
0c20: 65 6e 67 74 68 3a 20 32 36 35 0a 0a 3c 69 3e 63 ength: 265..<i>c
0c30: 6f 6e 74 65 6e 74 2e 2e 2e 3c 2f 69 3e 0a 3c 2f ontent...</i>.</
0c40: 70 72 65 3e 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 pre></blockquote
0c50: 3e 0a 0a 3c 70 3e 54 68 65 20 63 6f 6e 74 65 6e >..<p>The conten
0c60: 74 20 74 79 70 65 20 6f 66 20 74 68 65 20 72 65 t type of the re
0c70: 70 6c 79 20 69 73 20 61 6c 77 61 79 73 20 74 68 ply is always th
0c80: 65 20 73 61 6d 65 20 61 73 20 74 68 65 20 63 6f e same as the co
0c90: 6e 74 65 6e 74 20 74 79 70 65 0a 6f 66 20 74 68 ntent type.of th
0ca0: 65 20 72 65 71 75 65 73 74 2e 3c 2f 70 3e 0a 0a e request.</p>..
0cb0: 3c 68 32 3e 32 2e 30 20 46 6f 73 73 69 6c 20 53 <h2>2.0 Fossil S
0cc0: 79 6e 63 68 72 6f 6e 69 7a 61 74 69 6f 6e 20 43 ynchronization C
0cd0: 6f 6e 74 65 6e 74 3c 2f 68 32 3e 0a 0a 3c 70 3e ontent</h2>..<p>
0ce0: 41 20 73 79 6e 63 68 72 6f 6e 69 7a 61 74 69 6f A synchronizatio
0cf0: 6e 20 72 65 71 75 65 73 74 20 62 65 74 77 65 65 n request betwee
0d00: 6e 20 61 20 63 6c 69 65 6e 74 20 61 6e 64 20 73 n a client and s
0d10: 65 72 76 65 72 20 63 6f 6e 73 69 73 74 73 20 6f erver consists o
0d20: 66 0a 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 48 54 f.one or more HT
0d30: 54 50 20 72 65 71 75 65 73 74 73 20 61 73 20 64 TP requests as d
0d40: 65 73 63 72 69 62 65 64 20 69 6e 20 74 68 65 20 escribed in the
0d50: 70 72 65 76 69 6f 75 73 20 73 65 63 74 69 6f 6e previous section
0d60: 2e 20 20 54 68 69 73 0a 73 65 63 74 69 6f 6e 20 . This.section
0d70: 64 65 74 61 69 6c 73 20 74 68 65 20 22 78 2d 66 details the "x-f
0d80: 6f 73 73 69 6c 22 20 63 6f 6e 74 65 6e 74 20 74 ossil" content t
0d90: 79 70 65 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 32 2e ype.</p>..<h3>2.
0da0: 31 20 4c 69 6e 65 2d 6f 72 69 65 6e 74 65 64 20 1 Line-oriented
0db0: 46 6f 72 6d 61 74 3c 2f 68 33 3e 0a 0a 3c 70 3e Format</h3>..<p>
0dc0: 54 68 65 20 78 2d 66 6f 73 73 69 6c 20 63 6f 6e The x-fossil con
0dd0: 74 65 6e 74 20 74 79 70 65 20 63 6f 6e 73 69 73 tent type consis
0de0: 74 73 20 6f 66 20 7a 65 72 6f 20 6f 72 20 6d 6f ts of zero or mo
0df0: 72 65 20 22 63 61 72 64 73 22 2e 20 20 43 61 72 re "cards". Car
0e00: 64 73 0a 61 72 65 20 73 65 70 61 72 61 74 65 20 ds.are separate
0e10: 62 79 20 74 68 65 20 6e 65 77 6c 69 6e 65 20 63 by the newline c
0e20: 68 61 72 61 63 74 65 72 20 28 22 5c 6e 22 29 2e haracter ("\n").
0e30: 20 20 4c 65 61 64 69 6e 67 20 61 6e 64 20 74 72 Leading and tr
0e40: 61 69 6c 69 6e 67 0a 77 68 69 74 65 73 70 61 63 ailing.whitespac
0e50: 65 20 6f 6e 20 61 20 63 61 72 64 20 69 73 20 69 e on a card is i
0e60: 67 6e 6f 72 65 64 2e 20 20 42 6c 61 6e 6b 20 63 gnored. Blank c
0e70: 61 72 64 73 20 61 72 65 20 69 67 6e 6f 72 65 64 ards are ignored
0e80: 2e 3c 2f 70 3e 0a 0a 3c 70 3e 45 61 63 68 20 63 .</p>..<p>Each c
0e90: 61 72 64 20 69 73 20 64 69 76 69 64 65 64 20 69 ard is divided i
0ea0: 6e 74 6f 20 7a 65 72 6f 20 6f 72 20 6d 6f 72 65 nto zero or more
0eb0: 20 73 70 61 63 65 20 73 65 70 61 72 61 74 65 64 space separated
0ec0: 20 74 6f 6b 65 6e 73 2e 0a 54 68 65 20 66 69 72 tokens..The fir
0ed0: 73 74 20 74 6f 6b 65 6e 20 6f 6e 20 65 61 63 68 st token on each
0ee0: 20 63 61 72 64 20 69 73 20 74 68 65 20 6f 70 65 card is the ope
0ef0: 72 61 74 6f 72 2e 20 20 53 75 62 73 65 71 75 65 rator. Subseque
0f00: 6e 74 20 74 6f 6b 65 6e 73 0a 61 72 65 20 61 72 nt tokens.are ar
0f10: 67 75 6d 65 6e 74 73 2e 20 20 54 68 65 20 73 65 guments. The se
0f20: 74 20 6f 66 20 6f 70 65 72 61 74 6f 72 73 20 75 t of operators u
0f30: 6e 64 65 72 73 74 6f 6f 64 20 62 79 20 73 65 72 nderstood by ser
0f40: 76 65 72 73 20 69 73 20 73 6c 69 67 68 74 6c 79 vers is slightly
0f50: 0a 64 69 66 66 65 72 65 6e 74 20 66 72 6f 6d 20 .different from
0f60: 74 68 65 20 6f 70 65 72 61 74 6f 72 73 20 75 6e the operators un
0f70: 64 65 72 73 74 6f 6f 64 20 62 79 20 63 6c 69 65 derstood by clie
0f80: 6e 74 73 2c 20 74 68 6f 75 67 68 20 74 68 65 20 nts, though the
0f90: 74 77 6f 0a 61 72 65 20 76 65 72 79 20 73 69 6d two.are very sim
0fa0: 69 6c 61 72 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 32 ilar.</p>..<h3>2
0fb0: 2e 32 20 4c 6f 67 69 6e 20 43 61 72 64 73 3c 2f .2 Login Cards</
0fc0: 68 33 3e 0a 0a 3c 70 3e 45 76 65 72 79 20 6d 65 h3>..<p>Every me
0fd0: 73 73 61 67 65 20 66 72 6f 6d 20 63 6c 69 65 6e ssage from clien
0fe0: 74 20 74 6f 20 73 65 72 76 65 72 20 62 65 67 69 t to server begi
0ff0: 6e 73 20 77 69 74 68 20 6f 6e 65 20 6f 72 20 6d ns with one or m
1000: 6f 72 65 20 6c 6f 67 69 6e 0a 63 61 72 64 73 2e ore login.cards.
1010: 20 20 45 61 63 68 20 6c 6f 67 69 6e 20 63 61 72 Each login car
1020: 64 20 68 61 73 20 74 68 65 20 66 6f 6c 6c 6f 77 d has the follow
1030: 69 6e 67 20 66 6f 72 6d 61 74 3a 3c 2f 70 3e 0a ing format:</p>.
1040: 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62 .<blockquote>.<b
1050: 3e 6c 6f 67 69 6e 3c 2f 62 3e 20 20 3c 69 3e 75 >login</b> <i>u
1060: 73 65 72 69 64 20 20 6e 6f 6e 63 65 20 20 73 69 serid nonce si
1070: 67 6e 61 74 75 72 65 3c 2f 69 3e 0a 3c 2f 62 6c gnature</i>.</bl
1080: 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e 54 68 ockquote>..<p>Th
1090: 65 20 75 73 65 72 69 64 20 69 73 20 74 68 65 20 e userid is the
10a0: 6e 61 6d 65 20 6f 66 20 74 68 65 20 75 73 65 72 name of the user
10b0: 20 74 68 61 74 20 69 73 20 72 65 71 75 65 73 74 that is request
10c0: 69 6e 67 20 73 65 72 76 69 63 65 0a 66 72 6f 6d ing service.from
10d0: 20 74 68 65 20 73 65 72 76 65 72 2e 20 20 54 68 the server. Th
10e0: 65 20 6e 6f 6e 63 65 20 69 73 20 74 68 65 20 53 e nonce is the S
10f0: 48 41 31 20 68 61 73 68 20 6f 66 20 74 68 65 20 HA1 hash of the
1100: 72 65 6d 61 69 6e 64 65 72 20 6f 66 0a 74 68 65 remainder of.the
1110: 20 6d 65 73 73 61 67 65 20 2d 20 61 6c 6c 20 74 message - all t
1120: 65 78 74 20 74 68 61 74 20 66 6f 6c 6c 6f 77 73 ext that follows
1130: 20 74 68 65 20 6e 65 77 6c 69 6e 65 20 63 68 61 the newline cha
1140: 72 61 63 74 65 72 20 74 68 61 74 0a 74 65 72 6d racter that.term
1150: 69 6e 61 74 65 73 20 74 68 65 20 6c 6f 67 69 6e inates the login
1160: 20 63 61 72 64 2e 20 20 54 68 65 20 73 69 67 6e card. The sign
1170: 61 74 75 72 65 20 69 73 20 74 68 65 20 53 48 41 ature is the SHA
1180: 31 20 68 61 73 68 20 6f 66 0a 74 68 65 20 63 6f 1 hash of.the co
1190: 6e 63 61 74 65 6e 61 74 69 6f 6e 20 6f 66 20 74 ncatenation of t
11a0: 68 65 20 6e 6f 6e 63 65 20 61 6e 64 20 74 68 65 he nonce and the
11b0: 20 75 73 65 72 73 20 70 61 73 73 77 6f 72 64 2e users password.
11c0: 3c 2f 70 3e 0a 0a 3c 70 3e 46 6f 72 20 65 61 63 </p>..<p>For eac
11d0: 68 20 6c 6f 67 69 6e 20 63 61 72 64 2c 20 74 68 h login card, th
11e0: 65 20 73 65 72 76 65 72 20 6c 6f 6f 6b 73 20 75 e server looks u
11f0: 70 20 74 68 65 20 75 73 65 72 20 61 6e 64 20 76 p the user and v
1200: 65 72 69 66 69 65 73 0a 74 68 61 74 20 74 68 65 erifies.that the
1210: 20 6e 6f 6e 63 65 20 6d 61 74 63 68 65 73 20 74 nonce matches t
1220: 68 65 20 53 48 41 31 20 68 61 73 68 20 6f 66 20 he SHA1 hash of
1230: 74 68 65 20 72 65 6d 61 69 6e 64 65 72 20 6f 66 the remainder of
1240: 20 74 68 65 0a 6d 65 73 73 61 67 65 2e 20 20 49 the.message. I
1250: 74 20 74 68 65 6e 20 63 68 65 63 6b 73 20 74 68 t then checks th
1260: 65 20 73 69 67 6e 61 74 75 72 65 20 68 61 73 68 e signature hash
1270: 20 74 6f 20 6d 61 6b 65 20 73 75 72 65 20 74 68 to make sure th
1280: 65 20 0a 73 69 67 6e 61 74 75 72 65 20 6d 61 74 e .signature mat
1290: 63 68 65 73 2e 20 20 49 66 20 65 76 65 72 79 74 ches. If everyt
12a0: 68 69 6e 67 0a 63 68 65 63 6b 73 20 6f 75 74 2c hing.checks out,
12b0: 20 74 68 65 6e 20 74 68 65 20 63 6c 69 65 6e 74 then the client
12c0: 20 69 73 20 67 72 61 6e 74 65 64 20 61 6c 6c 20 is granted all
12d0: 70 72 69 76 69 6c 65 67 65 73 20 6f 66 20 74 68 privileges of th
12e0: 65 0a 73 70 65 63 69 66 69 65 64 20 75 73 65 72 e.specified user
12f0: 2e 3c 2f 70 3e 0a 0a 3c 70 3e 50 72 69 76 69 6c .</p>..<p>Privil
1300: 65 67 65 73 20 61 72 65 20 63 75 6d 75 6c 61 74 eges are cumulat
1310: 69 76 65 2e 20 20 54 68 65 72 65 20 63 61 6e 20 ive. There can
1320: 62 65 20 6d 75 6c 74 69 70 6c 65 20 73 75 63 63 be multiple succ
1330: 65 73 73 66 75 6c 0a 6c 6f 67 69 6e 20 63 61 72 essful.login car
1340: 64 73 2e 20 20 54 68 65 20 73 65 73 73 69 6f 6e ds. The session
1350: 20 70 72 69 76 69 6c 65 67 65 73 20 61 72 65 20 privileges are
1360: 74 68 65 20 62 69 74 2d 77 69 73 65 20 4f 52 20 the bit-wise OR
1370: 6f 66 20 74 68 65 0a 70 72 69 76 69 6c 65 67 65 of the.privilege
1380: 73 20 6f 66 20 65 61 63 68 20 69 6e 64 69 76 69 s of each indivi
1390: 64 75 61 6c 20 6c 6f 67 69 6e 2e 3c 2f 70 3e 0a dual login.</p>.
13a0: 0a 3c 68 33 3e 32 2e 33 20 46 69 6c 65 20 43 61 .<h3>2.3 File Ca
13b0: 72 64 73 3c 2f 68 33 3e 0a 0a 3c 70 3e 52 65 70 rds</h3>..<p>Rep
13c0: 6f 73 69 74 6f 72 79 20 63 6f 6e 74 65 6e 74 20 ository content
13d0: 72 65 63 6f 72 64 73 20 6f 72 20 66 69 6c 65 73 records or files
13e0: 20 61 72 65 20 74 72 61 6e 73 66 65 72 72 65 64 are transferred
13f0: 20 75 73 69 6e 67 0a 61 20 22 66 69 6c 65 22 20 using.a "file"
1400: 63 61 72 64 2e 20 20 46 69 6c 65 20 63 61 72 64 card. File card
1410: 73 20 63 6f 6d 65 20 69 6e 20 74 77 6f 20 64 69 s come in two di
1420: 66 66 65 72 65 6e 74 20 66 6f 72 6d 61 74 73 20 fferent formats
1430: 64 65 70 65 6e 64 69 6e 67 0a 6f 6e 20 77 68 65 depending.on whe
1440: 74 68 65 72 20 74 68 65 20 66 69 6c 65 20 69 73 ther the file is
1450: 20 73 65 6e 74 20 64 69 72 65 63 74 6c 79 20 6f sent directly o
1460: 72 20 61 73 20 61 20 64 65 6c 74 61 20 66 72 6f r as a delta fro
1470: 6d 20 73 6f 6d 65 0a 6f 74 68 65 72 20 66 69 6c m some.other fil
1480: 65 2e 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 e.</p>..<blockqu
1490: 6f 74 65 3e 0a 3c 62 3e 66 69 6c 65 3c 2f 62 3e ote>.<b>file</b>
14a0: 20 3c 69 3e 75 75 69 64 20 73 69 7a 65 3c 2f 69 <i>uuid size</i
14b0: 3e 20 3c 62 3e 5c 6e 3c 2f 62 3e 20 3c 69 3e 63 > <b>\n</b> <i>c
14c0: 6f 6e 74 65 6e 74 3c 2f 69 3e 3c 62 72 3e 0a 3c ontent</i><br>.<
14d0: 62 3e 66 69 6c 65 3c 2f 62 3e 20 3c 69 3e 75 75 b>file</b> <i>uu
14e0: 69 64 20 64 65 6c 74 61 2d 75 75 69 64 20 73 69 id delta-uuid si
14f0: 7a 65 3c 2f 69 3e 20 3c 62 3e 5c 6e 3c 2f 62 3e ze</i> <b>\n</b>
1500: 20 3c 69 3e 63 6f 6e 74 65 6e 74 3c 2f 69 3e 0a <i>content</i>.
1510: 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c </blockquote>..<
1520: 70 3e 46 69 6c 65 20 63 61 72 64 73 20 61 72 65 p>File cards are
1530: 20 64 69 66 66 65 72 65 6e 74 20 66 72 6f 6d 20 different from
1540: 61 6c 6c 20 6f 74 68 65 72 20 63 61 72 64 73 20 all other cards
1550: 69 6e 20 74 68 61 74 20 74 68 65 79 0a 66 6f 6c in that they.fol
1560: 6c 6f 77 65 64 20 62 79 20 69 6e 2d 6c 69 6e 65 lowed by in-line
1570: 20 22 70 61 79 6c 6f 61 64 22 20 64 61 74 61 2e "payload" data.
1580: 20 20 54 68 65 20 63 6f 6e 74 65 6e 74 20 6f 66 The content of
1590: 20 74 68 65 20 66 69 6c 65 0a 6f 72 20 74 68 65 the file.or the
15a0: 20 66 69 6c 65 20 64 65 6c 74 61 20 63 6f 6e 73 file delta cons
15b0: 69 73 74 73 20 6f 66 20 74 68 65 20 66 69 72 73 ists of the firs
15c0: 74 20 3c 69 3e 73 69 7a 65 3c 2f 69 3e 20 62 79 t <i>size</i> by
15d0: 74 65 73 20 6f 66 20 74 68 65 0a 78 2d 66 6f 73 tes of the.x-fos
15e0: 73 69 6c 20 63 6f 6e 74 65 6e 74 20 74 68 61 74 sil content that
15f0: 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 66 6f 6c immediately fol
1600: 6c 6f 77 20 74 68 65 20 6e 65 77 6c 69 6e 65 20 low the newline
1610: 74 68 61 74 0a 74 65 72 6d 69 6e 61 74 65 73 20 that.terminates
1620: 74 68 65 20 66 69 6c 65 20 63 61 72 64 2e 20 20 the file card.
1630: 4e 6f 20 6f 74 68 65 72 20 63 61 72 64 73 20 68 No other cards h
1640: 61 76 65 20 74 68 69 73 20 63 68 61 72 61 63 74 ave this charact
1650: 65 72 69 73 74 69 63 2e 0a 3c 2f 70 3e 0a 0a 3c eristic..</p>..<
1660: 70 3e 54 68 65 20 66 69 72 73 74 20 61 72 67 75 p>The first argu
1670: 6d 65 6e 74 20 6f 66 20 61 20 66 69 6c 65 20 63 ment of a file c
1680: 61 72 64 20 69 73 20 74 68 65 20 55 55 49 44 20 ard is the UUID
1690: 6f 66 20 74 68 65 20 66 69 6c 65 20 74 68 61 74 of the file that
16a0: 0a 69 73 20 62 65 69 6e 67 20 74 72 61 6e 73 66 .is being transf
16b0: 65 72 72 65 64 2e 20 20 54 68 65 20 55 55 49 44 erred. The UUID
16c0: 20 69 73 20 74 68 65 20 6c 6f 77 65 72 2d 63 61 is the lower-ca
16d0: 73 65 20 68 65 78 61 64 65 63 69 6d 61 6c 0a 72 se hexadecimal.r
16e0: 65 70 72 65 73 65 6e 74 61 74 69 6f 6e 20 6f 66 epresentation of
16f0: 20 74 68 65 20 53 48 41 31 20 68 61 73 68 20 6f the SHA1 hash o
1700: 66 20 74 68 65 20 65 6e 74 69 72 65 20 66 69 6c f the entire fil
1710: 65 20 63 6f 6e 74 65 6e 74 2e 0a 54 68 65 20 6c e content..The l
1720: 61 73 74 20 61 72 67 75 6d 65 6e 74 20 6f 66 20 ast argument of
1730: 74 68 65 20 66 69 6c 65 20 63 61 72 64 20 69 73 the file card is
1740: 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 62 the number of b
1750: 79 74 65 73 20 6f 66 0a 70 61 79 6c 6f 61 64 20 ytes of.payload
1760: 74 68 61 74 20 69 6d 6d 65 64 69 61 74 65 6c 79 that immediately
1770: 20 66 6f 6c 6c 6f 77 20 74 68 65 20 66 69 6c 65 follow the file
1780: 20 63 61 72 64 2e 20 20 49 66 20 74 68 65 20 66 card. If the f
1790: 69 6c 65 0a 63 61 72 64 20 68 61 73 20 6f 6e 6c ile.card has onl
17a0: 79 20 74 77 6f 20 61 72 67 75 6d 65 6e 74 73 2c y two arguments,
17b0: 20 74 68 61 74 20 6d 65 61 6e 73 20 74 68 65 20 that means the
17c0: 70 61 79 6c 6f 61 64 20 69 73 20 74 68 65 0a 63 payload is the.c
17d0: 6f 6d 70 6c 65 74 65 20 63 6f 6e 74 65 6e 74 20 omplete content
17e0: 6f 66 20 74 68 65 20 66 69 6c 65 2e 20 20 49 66 of the file. If
17f0: 20 74 68 65 20 66 69 6c 65 20 63 61 72 64 20 68 the file card h
1800: 61 73 20 74 68 72 65 65 0a 61 72 67 75 6d 65 6e as three.argumen
1810: 74 73 2c 20 74 68 65 6e 20 74 68 65 20 70 61 79 ts, then the pay
1820: 6c 6f 61 64 20 69 73 20 61 20 64 65 6c 74 61 20 load is a delta
1830: 61 6e 64 20 73 65 63 6f 6e 64 20 61 72 67 75 6d and second argum
1840: 65 6e 74 20 69 73 0a 74 68 65 20 55 55 49 44 20 ent is.the UUID
1850: 6f 66 20 61 6e 6f 74 68 65 72 20 66 69 6c 65 20 of another file
1860: 74 68 61 74 20 69 73 20 74 68 65 20 73 6f 75 72 that is the sour
1870: 63 65 20 6f 66 20 74 68 65 20 64 65 6c 74 61 2e ce of the delta.
1880: 3c 2f 70 3e 0a 0a 3c 70 3e 46 69 6c 65 20 63 61 </p>..<p>File ca
1890: 72 64 73 20 61 72 65 20 73 65 6e 74 20 69 6e 20 rds are sent in
18a0: 62 6f 74 68 20 64 69 72 65 63 74 69 6f 6e 73 3a both directions:
18b0: 20 63 6c 69 65 6e 74 20 74 6f 20 73 65 72 76 65 client to serve
18c0: 72 20 61 6e 64 0a 73 65 72 76 65 72 20 74 6f 20 r and.server to
18d0: 63 6c 69 65 6e 74 2e 20 20 41 20 64 65 6c 74 61 client. A delta
18e0: 20 6d 69 67 68 74 20 62 65 20 73 65 6e 74 20 62 might be sent b
18f0: 65 66 6f 72 65 20 74 68 65 20 73 6f 75 72 63 65 efore the source
1900: 20 6f 66 0a 74 68 65 20 64 65 6c 74 61 2c 20 73 of.the delta, s
1910: 6f 20 62 6f 74 68 20 63 6c 69 65 6e 74 20 61 6e o both client an
1920: 64 20 73 65 72 76 65 72 20 73 68 6f 75 6c 64 20 d server should
1930: 72 65 6d 65 6d 62 65 72 20 64 65 6c 74 61 73 0a remember deltas.
1940: 61 6e 64 20 62 65 20 61 62 6c 65 20 74 6f 20 61 and be able to a
1950: 70 70 6c 79 20 74 68 65 6d 20 77 68 65 6e 20 74 pply them when t
1960: 68 65 69 72 20 73 6f 75 72 63 65 20 61 72 72 69 heir source arri
1970: 76 65 73 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 32 2e ves.</p>..<h3>2.
1980: 34 20 50 75 73 68 20 61 6e 64 20 50 75 6c 6c 20 4 Push and Pull
1990: 43 61 72 64 73 3c 2f 68 33 3e 0a 0a 3c 70 3e 41 Cards</h3>..<p>A
19a0: 6d 6f 6e 67 20 6f 66 20 74 68 65 20 66 69 72 73 mong of the firs
19b0: 74 20 63 61 72 64 73 20 69 6e 20 61 20 63 6c 69 t cards in a cli
19c0: 65 6e 74 2d 74 6f 2d 73 65 72 76 65 72 20 6d 65 ent-to-server me
19d0: 73 73 61 67 65 20 61 72 65 0a 74 68 65 20 70 75 ssage are.the pu
19e0: 73 68 20 61 6e 64 20 70 75 6c 6c 20 63 61 72 64 sh and pull card
19f0: 73 2e 20 20 54 68 65 20 70 75 73 68 20 63 61 72 s. The push car
1a00: 64 20 74 65 6c 6c 20 74 68 65 20 73 65 72 76 65 d tell the serve
1a10: 72 20 74 68 61 74 0a 74 68 65 20 63 6c 69 65 6e r that.the clien
1a20: 74 20 69 73 20 70 75 73 68 69 6e 67 20 63 6f 6e t is pushing con
1a30: 74 65 6e 74 2e 20 20 54 68 65 20 70 75 6c 6c 20 tent. The pull
1a40: 63 61 72 64 20 74 65 6c 6c 20 74 68 65 20 73 65 card tell the se
1a50: 72 76 65 72 0a 74 68 61 74 20 74 68 65 20 63 6c rver.that the cl
1a60: 69 65 6e 74 20 77 61 6e 74 73 20 74 6f 20 70 75 ient wants to pu
1a70: 6c 6c 20 63 6f 6e 74 65 6e 74 2e 20 20 49 6e 20 ll content. In
1a80: 74 68 65 20 65 76 65 6e 74 20 6f 66 20 61 20 73 the event of a s
1a90: 79 6e 63 2c 0a 62 6f 74 68 20 63 61 72 64 73 20 ync,.both cards
1aa0: 61 72 65 20 73 65 6e 74 2e 20 20 54 68 65 20 66 are sent. The f
1ab0: 6f 72 6d 61 74 20 69 73 20 61 73 20 66 6f 6c 6c ormat is as foll
1ac0: 6f 77 73 3a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b ows:</p>..<block
1ad0: 71 75 6f 74 65 3e 0a 3c 62 3e 70 75 73 68 3c 2f quote>.<b>push</
1ae0: 62 3e 20 3c 69 3e 73 65 72 76 65 72 63 6f 64 65 b> <i>servercode
1af0: 20 70 72 6f 6a 65 63 74 63 6f 64 65 3c 2f 69 3e projectcode</i>
1b00: 3c 62 72 3e 0a 3c 62 3e 70 75 6c 6c 3c 2f 62 3e <br>.<b>pull</b>
1b10: 20 3c 69 3e 73 65 72 76 65 72 63 6f 64 65 20 70 <i>servercode p
1b20: 72 6f 6a 65 63 74 63 6f 64 65 3c 2f 69 3e 0a 3c rojectcode</i>.<
1b30: 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 /blockquote>..<p
1b40: 3e 54 68 65 20 3c 69 3e 73 65 72 76 65 72 63 6f >The <i>serverco
1b50: 64 65 3c 2f 69 3e 20 61 72 67 75 6d 65 6e 74 20 de</i> argument
1b60: 69 73 20 74 68 65 20 72 65 70 6f 73 69 74 6f 72 is the repositor
1b70: 79 20 49 44 20 66 6f 72 20 74 68 65 0a 63 6c 69 y ID for the.cli
1b80: 65 6e 74 2e 20 20 54 68 65 20 73 65 72 76 65 72 ent. The server
1b90: 20 77 69 6c 6c 20 6f 6e 6c 79 20 61 6c 6c 6f 77 will only allow
1ba0: 20 74 68 65 20 74 72 61 6e 73 61 63 74 69 6f 6e the transaction
1bb0: 20 74 6f 20 70 72 6f 63 65 65 64 0a 69 66 20 74 to proceed.if t
1bc0: 68 65 20 73 65 72 76 65 72 63 6f 64 65 20 69 73 he servercode is
1bd0: 20 64 69 66 66 65 72 65 6e 74 20 66 72 6f 6d 20 different from
1be0: 69 74 73 20 6f 77 6e 20 73 65 72 76 65 72 63 6f its own serverco
1bf0: 64 65 2e 20 20 54 68 69 73 0a 70 72 65 76 65 6e de. This.preven
1c00: 74 73 20 61 20 73 79 6e 63 2d 6c 6f 6f 70 2e 20 ts a sync-loop.
1c10: 20 54 68 65 20 3c 69 3e 70 72 6f 6a 65 63 74 63 The <i>projectc
1c20: 6f 64 65 3c 2f 69 3e 20 69 73 20 74 68 65 20 69 ode</i> is the i
1c30: 64 65 6e 74 69 66 69 65 72 0a 6f 66 20 74 68 65 dentifier.of the
1c40: 20 73 6f 66 74 77 61 72 65 20 70 72 6f 6a 65 63 software projec
1c50: 74 20 74 68 61 74 20 74 68 65 20 63 6c 69 65 6e t that the clien
1c60: 74 20 72 65 70 6f 73 69 74 6f 72 79 20 63 6f 6e t repository con
1c70: 74 61 69 6e 73 2e 0a 54 68 65 20 70 72 6f 6a 65 tains..The proje
1c80: 63 74 63 6f 64 65 20 66 6f 72 20 74 68 65 20 63 ctcode for the c
1c90: 6c 69 65 6e 74 20 61 6e 64 20 73 65 72 76 65 72 lient and server
1ca0: 20 6d 75 73 74 20 6d 61 74 63 68 20 69 6e 20 6f must match in o
1cb0: 72 64 65 72 0a 66 6f 72 20 74 68 65 20 74 72 61 rder.for the tra
1cc0: 6e 73 61 63 74 69 6f 6e 20 74 6f 20 70 72 6f 63 nsaction to proc
1cd0: 65 65 64 2e 3c 2f 70 3e 0a 0a 3c 70 3e 54 68 65 eed.</p>..<p>The
1ce0: 20 73 65 72 76 65 72 20 77 69 6c 6c 20 61 6c 73 server will als
1cf0: 6f 20 73 65 6e 64 20 61 20 70 75 73 68 20 63 61 o send a push ca
1d00: 72 64 20 62 61 63 6b 20 74 6f 20 74 68 65 20 63 rd back to the c
1d10: 6c 69 65 6e 74 0a 64 75 72 69 6e 67 20 61 20 63 lient.during a c
1d20: 6c 6f 6e 65 2e 20 20 54 68 69 73 20 69 73 20 68 lone. This is h
1d30: 6f 77 20 74 68 65 20 63 6c 69 65 6e 74 20 64 65 ow the client de
1d40: 74 65 72 6d 69 6e 65 73 20 77 68 61 74 20 70 72 termines what pr
1d50: 6f 6a 65 63 74 0a 63 6f 64 65 20 74 6f 20 70 75 oject.code to pu
1d60: 74 20 69 6e 20 74 68 65 20 6e 65 77 20 72 65 70 t in the new rep
1d70: 6f 73 69 74 6f 72 79 20 69 74 20 69 73 20 63 6f ository it is co
1d80: 6e 73 74 72 75 63 74 69 6e 67 2e 3c 2f 70 3e 0a nstructing.</p>.
1d90: 0a 3c 68 33 3e 32 2e 35 20 43 6c 6f 6e 65 20 43 .<h3>2.5 Clone C
1da0: 61 72 64 73 3c 2f 68 33 3e 0a 0a 3c 70 3e 41 20 ards</h3>..<p>A
1db0: 63 6c 6f 6e 65 20 63 61 72 64 20 77 6f 72 6b 73 clone card works
1dc0: 20 6c 69 6b 65 20 61 20 70 75 6c 6c 20 63 61 72 like a pull car
1dd0: 64 20 69 6e 20 74 68 61 74 20 69 74 20 69 73 20 d in that it is
1de0: 73 65 6e 74 20 66 72 6f 6d 0a 63 6c 69 65 6e 74 sent from.client
1df0: 20 74 6f 20 73 65 72 76 65 72 20 69 6e 20 6f 72 to server in or
1e00: 64 65 72 20 74 6f 20 74 65 6c 6c 20 74 68 65 20 der to tell the
1e10: 73 65 72 76 65 72 20 74 68 61 74 20 74 68 65 20 server that the
1e20: 63 6c 69 65 6e 74 0a 77 61 6e 74 73 20 74 6f 20 client.wants to
1e30: 70 75 6c 6c 20 63 6f 6e 74 65 6e 74 2e 20 20 42 pull content. B
1e40: 75 74 20 75 6e 6c 69 6b 65 20 74 68 65 20 70 75 ut unlike the pu
1e50: 6c 6c 20 63 61 72 64 2c 20 74 68 65 20 63 6c 6f ll card, the clo
1e60: 6e 65 0a 63 61 72 64 20 68 61 73 20 6e 6f 20 61 ne.card has no a
1e70: 72 67 75 6d 65 6e 74 73 2e 3c 2f 70 3e 0a 0a 3c rguments.</p>..<
1e80: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62 3e 63 blockquote>.<b>c
1e90: 6c 6f 6e 65 3c 2f 62 3e 0a 3c 2f 62 6c 6f 63 6b lone</b>.</block
1ea0: 71 75 6f 74 65 3e 0a 0a 3c 70 3e 49 6e 20 72 65 quote>..<p>In re
1eb0: 73 70 6f 6e 73 65 20 74 6f 20 61 20 63 6c 6f 6e sponse to a clon
1ec0: 65 20 6d 65 73 73 61 67 65 2c 20 74 68 65 20 73 e message, the s
1ed0: 65 72 76 65 72 20 61 6c 73 6f 20 73 65 6e 64 73 erver also sends
1ee0: 20 74 68 65 20 63 6c 69 65 6e 74 0a 61 20 70 75 the client.a pu
1ef0: 73 68 20 6d 65 73 73 61 67 65 20 73 6f 20 74 68 sh message so th
1f00: 61 74 20 74 68 65 20 63 6c 69 65 6e 74 20 63 61 at the client ca
1f10: 6e 20 64 69 73 63 6f 76 65 72 20 74 68 65 20 70 n discover the p
1f20: 72 6f 6a 65 63 74 63 6f 64 65 20 66 6f 72 0a 74 rojectcode for.t
1f30: 68 69 73 20 70 72 6f 6a 65 63 74 2e 3c 2f 70 3e his project.</p>
1f40: 0a 0a 3c 68 33 3e 32 2e 36 20 49 67 6f 74 20 43 ..<h3>2.6 Igot C
1f50: 61 72 64 73 3c 2f 68 33 3e 0a 0a 3c 70 3e 41 6e ards</h3>..<p>An
1f60: 20 69 67 6f 74 20 63 61 72 64 20 63 61 6e 20 62 igot card can b
1f70: 65 20 73 65 6e 74 20 66 72 6f 6d 20 65 69 74 68 e sent from eith
1f80: 65 72 20 63 6c 69 65 6e 74 20 74 6f 20 73 65 72 er client to ser
1f90: 76 65 72 20 6f 72 20 66 72 6f 6d 0a 73 65 72 76 ver or from.serv
1fa0: 65 72 20 74 6f 20 63 6c 69 65 6e 74 20 69 6e 20 er to client in
1fb0: 6f 72 64 65 72 20 74 6f 20 69 6e 64 69 63 61 74 order to indicat
1fc0: 65 20 74 68 61 74 20 74 68 65 20 73 65 6e 64 65 e that the sende
1fd0: 72 20 68 6f 6c 64 73 20 61 20 63 6f 70 79 0a 6f r holds a copy.o
1fe0: 66 20 61 20 70 61 72 74 69 63 75 6c 61 72 20 66 f a particular f
1ff0: 69 6c 65 2e 20 20 54 68 65 20 66 6f 72 6d 61 74 ile. The format
2000: 20 69 73 3a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b is:</p>..<block
2010: 71 75 6f 74 65 3e 0a 3c 62 3e 69 67 6f 74 3c 2f quote>.<b>igot</
2020: 62 3e 20 3c 69 3e 75 75 69 64 3c 2f 69 3e 0a 3c b> <i>uuid</i>.<
2030: 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 /blockquote>..<p
2040: 3e 54 68 65 20 61 72 67 75 6d 65 6e 74 20 6f 66 >The argument of
2050: 20 74 68 65 20 69 67 6f 74 20 63 61 72 64 20 69 the igot card i
2060: 73 20 74 68 65 20 55 55 49 44 20 6f 66 20 74 68 s the UUID of th
2070: 65 20 66 69 6c 65 20 74 68 61 74 0a 74 68 65 20 e file that.the
2080: 73 65 6e 64 65 72 20 70 6f 73 73 65 73 73 65 73 sender possesses
2090: 2e 0a 54 68 65 20 72 65 63 65 69 76 65 72 20 6f ..The receiver o
20a0: 66 20 61 6e 20 69 67 6f 74 20 63 61 72 64 20 77 f an igot card w
20b0: 69 6c 6c 20 74 79 70 69 63 61 6c 6c 79 20 63 68 ill typically ch
20c0: 65 63 6b 20 74 6f 20 73 65 65 20 69 66 0a 69 74 eck to see if.it
20d0: 20 61 6c 73 6f 20 68 6f 6c 64 73 20 74 68 65 20 also holds the
20e0: 73 61 6d 65 20 66 69 6c 65 20 61 6e 64 20 69 66 same file and if
20f0: 20 6e 6f 74 20 69 74 20 77 69 6c 6c 20 72 65 71 not it will req
2100: 75 65 73 74 20 74 68 65 20 66 69 6c 65 0a 75 73 uest the file.us
2110: 69 6e 67 20 61 20 67 69 6d 6d 65 20 63 61 72 64 ing a gimme card
2120: 20 69 6e 20 65 69 74 68 65 72 20 74 68 65 20 72 in either the r
2130: 65 70 6c 79 20 6f 72 20 69 6e 20 74 68 65 20 6e eply or in the n
2140: 65 78 74 20 6d 65 73 73 61 67 65 2e 3c 2f 70 3e ext message.</p>
2150: 0a 0a 3c 68 33 3e 32 2e 37 20 47 69 6d 6d 65 20 ..<h3>2.7 Gimme
2160: 43 61 72 64 73 3c 2f 68 33 3e 0a 0a 3c 70 3e 41 Cards</h3>..<p>A
2170: 20 67 69 6d 6d 65 20 63 61 72 64 20 69 73 20 73 gimme card is s
2180: 65 6e 74 20 66 72 6f 6d 20 65 69 74 68 65 72 20 ent from either
2190: 63 6c 69 65 6e 74 20 74 6f 20 73 65 72 76 65 72 client to server
21a0: 20 6f 72 20 66 72 6f 6d 20 73 65 72 76 65 72 0a or from server.
21b0: 74 6f 20 63 6c 69 65 6e 74 2e 20 20 54 68 65 20 to client. The
21c0: 67 69 6d 6d 65 20 63 61 72 64 20 61 73 6b 73 20 gimme card asks
21d0: 74 68 65 20 72 65 63 65 69 76 65 72 20 74 6f 20 the receiver to
21e0: 73 65 6e 64 20 61 20 70 61 72 74 69 63 75 6c 61 send a particula
21f0: 72 0a 66 69 6c 65 20 62 61 63 6b 20 74 6f 20 74 r.file back to t
2200: 68 65 20 73 65 6e 64 65 72 2e 20 20 54 68 65 20 he sender. The
2210: 66 6f 72 6d 61 74 20 6f 66 20 61 20 67 69 6d 6d format of a gimm
2220: 65 20 63 61 72 64 20 69 73 20 74 68 69 73 3a 3c e card is this:<
2230: 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 /p>..<blockquote
2240: 3e 0a 3c 62 3e 67 69 6d 6d 65 3c 2f 62 3e 20 3c >.<b>gimme</b> <
2250: 69 3e 75 75 69 64 3c 2f 69 3e 0a 3c 2f 62 6c 6f i>uuid</i>.</blo
2260: 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e 54 68 65 ckquote>..<p>The
2270: 20 61 72 67 75 6d 65 6e 74 20 74 6f 20 74 68 65 argument to the
2280: 20 67 69 6d 6d 65 20 63 61 72 64 20 69 73 20 74 gimme card is t
2290: 68 65 20 55 55 49 44 20 6f 66 20 74 68 65 20 66 he UUID of the f
22a0: 69 6c 65 20 74 68 61 74 0a 74 68 65 20 73 65 6e ile that.the sen
22b0: 64 65 72 20 77 61 6e 74 73 2e 20 20 54 68 65 20 der wants. The
22c0: 72 65 63 65 69 76 65 72 20 77 69 6c 6c 20 74 79 receiver will ty
22d0: 70 69 63 61 6c 6c 79 20 72 65 73 70 6f 6e 64 20 pically respond
22e0: 74 6f 20 61 0a 67 69 6d 6d 65 20 63 61 72 64 20 to a.gimme card
22f0: 62 79 20 73 65 6e 64 69 6e 67 20 61 20 66 69 6c by sending a fil
2300: 65 20 63 61 72 64 20 69 6e 20 69 74 73 20 72 65 e card in its re
2310: 70 6c 79 20 6f 72 20 69 6e 20 74 68 65 20 6e 65 ply or in the ne
2320: 78 74 0a 6d 65 73 73 61 67 65 2e 3c 2f 70 3e 0a xt.message.</p>.
2330: 0a 3c 68 33 3e 32 2e 38 20 43 6f 6f 6b 69 65 20 .<h3>2.8 Cookie
2340: 43 61 72 64 73 3c 2f 68 33 3e 0a 0a 3c 70 3e 41 Cards</h3>..<p>A
2350: 20 63 6f 6f 6b 69 65 20 63 61 72 64 20 63 61 6e cookie card can
2360: 20 62 65 20 75 73 65 64 20 62 79 20 61 20 73 65 be used by a se
2370: 72 76 65 72 20 74 6f 20 72 65 63 6f 72 64 20 61 rver to record a
2380: 20 73 6d 61 6c 6c 20 61 6d 6f 75 6e 74 0a 6f 66 small amount.of
2390: 20 73 74 61 74 65 20 69 6e 66 6f 72 6d 61 74 69 state informati
23a0: 6f 6e 20 6f 6e 20 61 20 63 6c 69 65 6e 74 2e 20 on on a client.
23b0: 20 54 68 65 20 73 65 72 76 65 72 20 73 65 6e 64 The server send
23c0: 73 20 61 20 63 6f 6f 6b 69 65 20 74 6f 20 74 68 s a cookie to th
23d0: 65 0a 63 6c 69 65 6e 74 2e 20 20 54 68 65 20 63 e.client. The c
23e0: 6c 69 65 6e 74 20 73 65 6e 64 73 20 74 68 65 20 lient sends the
23f0: 73 61 6d 65 20 63 6f 6f 6b 69 65 20 62 61 63 6b same cookie back
2400: 20 74 6f 20 74 68 65 20 73 65 72 76 65 72 20 6f to the server o
2410: 6e 0a 69 74 73 20 6e 65 78 74 20 72 65 71 75 65 n.its next reque
2420: 73 74 2e 20 20 54 68 65 20 63 6f 6f 6b 69 65 20 st. The cookie
2430: 63 61 72 64 20 68 61 73 20 61 20 73 69 6e 67 6c card has a singl
2440: 65 20 61 72 67 75 6d 65 6e 74 20 77 68 69 63 68 e argument which
2450: 0a 69 73 20 69 74 73 20 70 61 79 6c 6f 61 64 2e .is its payload.
2460: 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 </p>..<blockquot
2470: 65 3e 0a 3c 62 3e 63 6f 6f 6b 69 65 3c 2f 62 3e e>.<b>cookie</b>
2480: 20 3c 69 3e 70 61 79 6c 6f 61 64 3c 2f 69 3e 0a <i>payload</i>.
2490: 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c </blockquote>..<
24a0: 70 3e 54 68 65 20 63 6c 69 65 6e 74 20 69 73 20 p>The client is
24b0: 6e 6f 74 20 72 65 71 75 69 72 65 64 20 74 6f 20 not required to
24c0: 72 65 74 75 72 6e 20 74 68 65 20 63 6f 6f 6b 69 return the cooki
24d0: 65 20 74 6f 20 74 68 65 20 73 65 72 76 65 72 20 e to the server
24e0: 6f 6e 0a 69 74 73 20 6e 65 78 74 20 72 65 71 75 on.its next requ
24f0: 65 73 74 2e 20 20 4f 72 20 74 68 65 20 63 6c 69 est. Or the cli
2500: 65 6e 74 20 6d 69 67 68 74 20 73 65 6e 64 20 61 ent might send a
2510: 20 63 6f 6f 6b 69 65 20 66 72 6f 6d 20 61 20 64 cookie from a d
2520: 69 66 66 65 72 65 6e 74 0a 73 65 72 76 65 72 20 ifferent.server
2530: 6f 6e 20 74 68 65 20 6e 65 78 74 20 72 65 71 75 on the next requ
2540: 65 73 74 2e 20 20 53 6f 20 74 68 65 20 73 65 72 est. So the ser
2550: 76 65 72 20 6d 75 73 74 20 6e 6f 74 20 64 65 70 ver must not dep
2560: 65 6e 64 20 6f 6e 20 74 68 65 0a 63 6f 6f 6b 69 end on the.cooki
2570: 65 20 61 6e 64 20 74 68 65 20 73 65 72 76 65 72 e and the server
2580: 20 6d 75 73 74 20 73 74 72 75 63 74 75 72 65 20 must structure
2590: 74 68 65 20 63 6f 6f 6b 69 65 20 70 61 79 6c 6f the cookie paylo
25a0: 61 64 20 69 6e 20 73 75 63 68 0a 61 20 77 61 79 ad in such.a way
25b0: 20 74 68 61 74 20 69 74 20 63 61 6e 20 74 65 6c that it can tel
25c0: 6c 20 69 66 20 74 68 65 20 63 6f 6f 6b 69 65 20 l if the cookie
25d0: 69 74 20 73 65 65 73 20 69 73 20 69 74 73 20 6f it sees is its o
25e0: 77 6e 20 63 6f 6f 6b 69 65 20 6f 72 0a 61 20 63 wn cookie or.a c
25f0: 6f 6f 6b 69 65 20 66 72 6f 6d 20 61 6e 6f 74 68 ookie from anoth
2600: 65 72 20 73 65 72 76 65 72 2e 20 20 28 54 79 70 er server. (Typ
2610: 69 63 61 6c 6c 79 20 74 68 65 20 73 65 72 76 65 ically the serve
2620: 72 20 77 69 6c 6c 20 65 6d 62 65 64 0a 69 74 73 r will embed.its
2630: 20 73 65 72 76 65 72 63 6f 64 65 20 61 73 20 70 servercode as p
2640: 61 72 74 20 6f 66 20 74 68 65 20 63 6f 6f 6b 69 art of the cooki
2650: 65 2e 29 3c 2f 70 3e 0a 0a 3c 68 33 3e 32 2e 39 e.)</p>..<h3>2.9
2660: 20 45 72 72 6f 72 20 43 61 72 64 73 3c 2f 68 33 Error Cards</h3
2670: 3e 0a 0a 3c 70 3e 49 66 20 74 68 65 20 73 65 72 >..<p>If the ser
2680: 76 65 72 20 64 69 73 63 6f 76 65 72 73 20 61 6e ver discovers an
2690: 79 74 68 69 6e 67 20 77 72 6f 6e 67 20 77 69 74 ything wrong wit
26a0: 68 20 61 20 72 65 71 75 65 73 74 2c 20 69 74 20 h a request, it
26b0: 67 65 6e 65 72 61 74 65 73 0a 61 6e 20 65 72 72 generates.an err
26c0: 6f 72 20 63 61 72 64 20 69 6e 20 69 74 73 20 72 or card in its r
26d0: 65 70 6c 79 2e 20 20 57 68 65 6e 20 74 68 65 20 eply. When the
26e0: 63 6c 69 65 6e 74 20 73 65 65 73 20 74 68 65 20 client sees the
26f0: 65 72 72 6f 72 20 63 61 72 64 2c 0a 69 74 20 64 error card,.it d
2700: 69 73 70 6c 61 79 73 20 61 6e 20 65 72 72 6f 72 isplays an error
2710: 20 6d 65 73 73 61 67 65 20 74 6f 20 74 68 65 20 message to the
2720: 75 73 65 72 20 61 6e 64 20 61 62 6f 72 74 73 20 user and aborts
2730: 74 68 65 20 73 79 6e 63 0a 6f 70 65 72 61 74 69 the sync.operati
2740: 6f 6e 2e 20 20 41 6e 20 65 72 72 6f 72 20 63 61 on. An error ca
2750: 72 64 20 6c 6f 6f 6b 73 20 6c 69 6b 65 20 74 68 rd looks like th
2760: 69 73 3a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 is:</p>..<blockq
2770: 75 6f 74 65 3e 0a 3c 62 3e 65 72 72 6f 72 3c 2f uote>.<b>error</
2780: 62 3e 20 3c 69 3e 65 72 72 6f 72 2d 6d 65 73 73 b> <i>error-mess
2790: 61 67 65 3c 2f 69 3e 0a 3c 2f 62 6c 6f 63 6b 71 age</i>.</blockq
27a0: 75 6f 74 65 3e 0a 0a 3c 70 3e 54 68 65 20 65 72 uote>..<p>The er
27b0: 72 6f 72 20 6d 65 73 73 61 67 65 20 69 73 20 45 ror message is E
27c0: 6e 67 6c 69 73 68 20 74 65 78 74 20 74 68 61 74 nglish text that
27d0: 20 69 73 20 65 6e 63 6f 64 65 64 20 69 6e 20 6f is encoded in o
27e0: 72 64 65 72 20 74 6f 0a 62 65 20 61 20 73 69 6e rder to.be a sin
27f0: 67 6c 65 20 74 6f 6b 65 6e 2e 0a 41 20 73 70 61 gle token..A spa
2800: 63 65 20 28 41 53 43 49 49 20 30 78 32 30 29 20 ce (ASCII 0x20)
2810: 69 73 20 72 65 70 72 65 73 65 6e 74 65 64 20 61 is represented a
2820: 73 20 22 5c 73 22 20 28 41 53 43 49 49 20 30 78 s "\s" (ASCII 0x
2830: 35 43 2c 20 30 78 37 33 29 2e 20 20 41 0a 6e 65 5C, 0x73). A.ne
2840: 77 6c 69 6e 65 20 28 41 53 43 49 49 20 30 78 30 wline (ASCII 0x0
2850: 61 29 20 69 73 20 22 5c 6e 22 20 28 41 53 43 49 a) is "\n" (ASCI
2860: 49 20 30 78 36 43 2c 20 78 36 45 29 2e 20 20 41 I 0x6C, x6E). A
2870: 20 62 61 63 6b 73 6c 61 73 68 20 0a 28 41 53 43 backslash .(ASC
2880: 49 49 20 30 78 35 43 29 20 69 73 20 72 65 70 72 II 0x5C) is repr
2890: 65 73 65 6e 74 65 64 20 61 73 20 74 77 6f 20 62 esented as two b
28a0: 61 63 6b 73 6c 61 73 68 65 73 20 22 5c 5c 22 2e ackslashes "\\".
28b0: 20 20 41 70 61 72 74 20 66 72 6f 6d 0a 73 70 61 Apart from.spa
28c0: 63 65 20 61 6e 64 20 6e 65 77 6c 69 6e 65 2c 20 ce and newline,
28d0: 6e 6f 20 6f 74 68 65 72 20 77 68 69 74 65 73 70 no other whitesp
28e0: 61 63 65 20 63 68 61 72 61 63 74 65 72 73 20 6e ace characters n
28f0: 6f 72 20 61 6e 79 0a 75 6e 70 72 69 6e 74 61 62 or any.unprintab
2900: 6c 65 20 63 68 61 72 61 63 74 65 72 73 20 61 72 le characters ar
2910: 65 20 61 6c 6c 6f 77 65 64 20 69 6e 0a 74 68 65 e allowed in.the
2920: 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65 2e 3c error message.<
2930: 2f 70 3e 0a 0a 3c 68 33 3e 32 2e 31 30 20 55 6e /p>..<h3>2.10 Un
2940: 6b 6e 6f 77 6e 20 43 61 72 64 73 3c 2f 68 33 3e known Cards</h3>
2950: 0a 0a 3c 70 3e 49 66 20 65 69 74 68 65 72 20 74 ..<p>If either t
2960: 68 65 20 63 6c 69 65 6e 74 20 6f 72 20 74 68 65 he client or the
2970: 20 73 65 72 76 65 72 20 73 65 65 73 20 61 20 63 server sees a c
2980: 61 72 64 20 74 68 61 74 20 69 73 20 6e 6f 74 0a ard that is not.
2990: 64 65 73 63 72 69 62 65 64 20 61 62 6f 76 65 2c described above,
29a0: 20 74 68 65 6e 20 69 74 20 67 65 6e 65 72 61 74 then it generat
29b0: 65 73 20 61 6e 20 65 72 72 6f 72 20 61 6e 64 20 es an error and
29c0: 61 62 6f 72 74 73 2e 3c 2f 70 3e 0a 0a 3c 68 32 aborts.</p>..<h2
29d0: 3e 33 2e 30 20 50 68 61 6e 74 6f 6d 73 20 41 6e >3.0 Phantoms An
29e0: 64 20 43 6c 75 73 74 65 72 73 3c 2f 68 32 3e 0a d Clusters</h2>.
29f0: 0a 3c 70 3e 57 68 65 6e 20 61 20 72 65 70 6f 73 .<p>When a repos
2a00: 69 74 6f 72 79 20 6b 6e 6f 77 73 20 74 68 61 74 itory knows that
2a10: 20 61 20 66 69 6c 65 20 65 78 69 73 74 73 20 61 a file exists a
2a20: 6e 64 20 6b 6e 6f 77 73 20 74 68 65 20 55 55 49 nd knows the UUI
2a30: 44 20 6f 66 0a 74 68 61 74 20 66 69 6c 65 2c 20 D of.that file,
2a40: 62 75 74 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 but it does not
2a50: 6b 6e 6f 77 20 74 68 65 20 66 69 6c 65 20 63 6f know the file co
2a60: 6e 74 65 6e 74 2c 20 74 68 65 6e 20 69 74 20 73 ntent, then it s
2a70: 74 6f 72 65 73 20 74 68 61 74 0a 66 69 6c 65 20 tores that.file
2a80: 61 73 20 61 20 22 70 68 61 6e 74 6f 6d 22 2e 20 as a "phantom".
2a90: 20 41 20 72 65 70 6f 73 69 74 6f 72 79 20 77 69 A repository wi
2aa0: 6c 6c 20 74 79 70 69 63 61 6c 6c 79 20 63 72 65 ll typically cre
2ab0: 61 74 65 20 61 20 70 68 61 6e 74 6f 6d 20 77 68 ate a phantom wh
2ac0: 65 6e 0a 69 74 20 72 65 63 65 69 76 65 73 20 61 en.it receives a
2ad0: 6e 20 69 67 6f 74 20 63 61 72 64 20 66 6f 72 20 n igot card for
2ae0: 61 20 66 69 6c 65 20 74 68 61 74 20 69 74 20 64 a file that it d
2af0: 6f 65 73 20 6e 6f 74 20 68 6f 6c 64 20 6f 72 20 oes not hold or
2b00: 77 68 65 6e 20 69 74 0a 72 65 63 65 69 76 65 73 when it.receives
2b10: 20 61 20 66 69 6c 65 20 63 61 72 64 20 74 68 61 a file card tha
2b20: 74 20 72 65 66 65 72 65 6e 63 65 73 20 61 20 64 t references a d
2b30: 65 6c 74 61 20 73 6f 75 72 63 65 20 74 68 61 74 elta source that
2b40: 20 69 74 20 64 6f 65 73 20 6e 6f 74 0a 68 6f 6c it does not.hol
2b50: 64 2e 20 20 57 68 65 6e 20 61 20 73 65 72 76 65 d. When a serve
2b60: 72 20 69 73 20 67 65 6e 65 72 61 74 69 6e 67 20 r is generating
2b70: 69 74 73 20 72 65 70 6c 79 20 6f 72 20 77 68 65 its reply or whe
2b80: 6e 20 61 20 63 6c 69 65 6e 74 20 69 73 0a 67 65 n a client is.ge
2b90: 6e 65 72 61 74 69 6e 67 20 61 20 6e 65 77 20 72 nerating a new r
2ba0: 65 71 75 65 73 74 2c 20 69 74 20 77 69 6c 6c 20 equest, it will
2bb0: 75 73 75 61 6c 6c 79 20 73 65 6e 64 20 67 69 6d usually send gim
2bc0: 6d 65 20 63 61 72 64 73 20 66 6f 72 20 65 76 65 me cards for eve
2bd0: 72 79 0a 70 68 61 6e 74 6f 6d 20 74 68 61 74 20 ry.phantom that
2be0: 69 74 20 68 6f 6c 64 73 2e 3c 2f 70 3e 0a 0a 3c it holds.</p>..<
2bf0: 70 3e 41 20 63 6c 75 73 74 65 72 20 69 73 20 61 p>A cluster is a
2c00: 20 73 70 65 63 69 61 6c 20 66 69 6c 65 20 74 68 special file th
2c10: 61 74 20 74 65 6c 6c 73 20 6f 66 20 74 68 65 20 at tells of the
2c20: 65 78 69 73 74 65 6e 63 65 20 6f 66 20 6f 74 68 existence of oth
2c30: 65 72 0a 66 69 6c 65 73 2e 20 20 41 6e 79 20 66 er.files. Any f
2c40: 69 6c 65 20 69 6e 20 74 68 65 20 72 65 70 6f 73 ile in the repos
2c50: 69 74 6f 72 79 20 74 68 61 74 20 66 6f 6c 6c 6f itory that follo
2c60: 77 73 20 74 68 65 20 73 79 6e 74 61 63 74 69 63 ws the syntactic
2c70: 20 72 75 6c 65 73 0a 6f 66 20 61 20 63 6c 75 73 rules.of a clus
2c80: 74 65 72 20 69 73 20 63 6f 6e 73 69 64 65 72 65 ter is considere
2c90: 64 20 61 20 63 6c 75 73 74 65 72 2e 3c 2f 70 3e d a cluster.</p>
2ca0: 0a 0a 3c 70 3e 41 20 63 6c 75 73 74 65 72 20 69 ..<p>A cluster i
2cb0: 73 20 61 20 6c 69 6e 65 20 6f 72 69 65 6e 74 65 s a line oriente
2cc0: 64 20 66 69 6c 65 2e 20 20 45 61 63 68 20 6c 69 d file. Each li
2cd0: 6e 65 20 6f 66 20 61 20 63 6c 75 73 74 65 72 0a ne of a cluster.
2ce0: 69 73 20 61 20 63 61 72 64 2e 20 20 54 68 65 20 is a card. The
2cf0: 63 61 72 64 73 20 61 72 65 20 73 65 70 61 72 61 cards are separa
2d00: 74 65 64 20 62 79 20 74 68 65 20 6e 65 77 6c 69 ted by the newli
2d10: 6e 65 20 28 22 5c 6e 22 29 20 63 68 61 72 61 63 ne ("\n") charac
2d20: 74 65 72 2e 0a 45 61 63 68 20 63 61 72 64 20 63 ter..Each card c
2d30: 6f 6e 73 69 73 74 73 20 6f 66 20 61 20 73 69 6e onsists of a sin
2d40: 67 6c 65 20 63 68 61 72 61 63 74 65 72 20 63 61 gle character ca
2d50: 72 64 20 74 79 70 65 2c 20 61 20 73 70 61 63 65 rd type, a space
2d60: 2c 20 61 6e 64 20 61 0a 73 69 6e 67 6c 65 20 61 , and a.single a
2d70: 72 67 75 6d 65 6e 74 2e 20 20 4e 6f 20 65 78 74 rgument. No ext
2d80: 72 61 20 77 68 69 74 65 73 70 61 63 65 20 61 6e ra whitespace an
2d90: 64 20 6e 6f 20 74 72 61 69 6c 69 6e 67 20 6f 72 d no trailing or
2da0: 20 6c 65 61 64 69 6e 67 0a 77 68 69 74 65 73 70 leading.whitesp
2db0: 61 63 65 20 69 73 20 61 6c 6c 6f 77 65 64 2e 20 ace is allowed.
2dc0: 20 41 6c 6c 20 63 61 72 64 73 20 69 6e 20 74 68 All cards in th
2dd0: 65 20 63 6c 75 73 74 65 72 20 6d 75 73 74 20 6f e cluster must o
2de0: 63 63 75 72 20 69 6e 0a 73 74 72 69 63 74 20 6c ccur in.strict l
2df0: 65 78 69 63 6f 67 72 61 70 68 69 63 61 6c 20 6f exicographical o
2e00: 72 64 65 72 2e 3c 2f 70 3e 0a 0a 3c 70 3e 41 20 rder.</p>..<p>A
2e10: 63 6c 75 73 74 65 72 20 63 6f 6e 73 69 73 74 73 cluster consists
2e20: 20 6f 66 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 of one or more
2e30: 22 4d 22 20 63 61 72 64 73 20 66 6f 6c 6c 6f 77 "M" cards follow
2e40: 65 64 20 62 79 20 61 20 73 69 6e 67 6c 65 0a 22 ed by a single."
2e50: 5a 22 20 63 61 72 64 2e 20 20 45 61 63 68 20 4d Z" card. Each M
2e60: 20 63 61 72 64 20 68 6f 6c 64 73 20 61 6e 20 61 card holds an a
2e70: 72 67 75 6d 65 6e 74 20 77 68 69 63 68 20 69 73 rgument which is
2e80: 20 61 20 55 55 49 44 20 66 6f 72 20 61 20 66 69 a UUID for a fi
2e90: 6c 65 0a 69 6e 20 74 68 65 20 72 65 70 6f 73 69 le.in the reposi
2ea0: 74 6f 72 79 2e 20 20 54 68 65 20 5a 20 63 61 72 tory. The Z car
2eb0: 64 20 68 61 73 20 61 20 73 69 6e 67 6c 65 20 61 d has a single a
2ec0: 72 67 75 6d 65 6e 74 20 77 68 69 63 68 20 69 73 rgument which is
2ed0: 20 74 68 65 0a 6c 6f 77 65 72 2d 63 61 73 65 20 the.lower-case
2ee0: 68 65 78 61 64 65 63 69 6d 61 6c 20 72 65 70 72 hexadecimal repr
2ef0: 65 73 65 6e 74 61 74 69 6f 6e 20 6f 66 20 74 68 esentation of th
2f00: 65 20 4d 44 35 20 63 68 65 63 6b 73 75 6d 20 6f e MD5 checksum o
2f10: 66 20 61 6c 6c 0a 70 72 65 63 65 64 69 6e 67 20 f all.preceding
2f20: 4d 20 63 61 72 64 73 20 75 70 20 74 6f 20 61 6e M cards up to an
2f30: 64 20 69 6e 63 6c 75 64 65 64 20 74 68 65 20 6e d included the n
2f40: 65 77 6c 69 6e 65 20 63 68 61 72 61 63 74 65 72 ewline character
2f50: 20 74 68 61 74 0a 6f 63 63 75 72 72 65 64 20 6a that.occurred j
2f60: 75 73 74 20 62 65 66 6f 72 65 20 74 68 65 20 5a ust before the Z
2f70: 20 74 68 61 74 20 73 74 61 72 74 73 20 74 68 65 that starts the
2f80: 20 5a 20 63 61 72 64 2e 3c 2f 70 3e 0a 0a 3c 70 Z card.</p>..<p
2f90: 3e 41 6e 79 20 66 69 6c 65 20 74 68 61 74 20 64 >Any file that d
2fa0: 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 74 68 oes not match th
2fb0: 65 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e 73 e specifications
2fc0: 20 6f 66 20 61 20 63 6c 75 73 74 65 72 0a 65 78 of a cluster.ex
2fd0: 61 63 74 6c 79 20 69 73 20 6e 6f 74 20 61 20 63 actly is not a c
2fe0: 6c 75 73 74 65 72 2e 20 20 54 68 65 72 65 20 6d luster. There m
2ff0: 75 73 74 20 62 65 20 6e 6f 20 65 78 74 72 61 20 ust be no extra
3000: 77 68 69 74 65 73 70 61 63 65 20 69 6e 0a 74 68 whitespace in.th
3010: 65 20 66 69 6c 65 2e 20 20 54 68 65 72 65 20 6d e file. There m
3020: 75 73 74 20 62 65 20 6f 6e 65 20 6f 72 20 6d 6f ust be one or mo
3030: 72 65 20 4d 20 63 61 72 64 73 2e 20 20 54 68 65 re M cards. The
3040: 72 65 20 6d 75 73 74 20 62 65 20 61 0a 73 69 6e re must be a.sin
3050: 67 6c 65 20 5a 20 63 61 72 64 20 77 69 74 68 20 gle Z card with
3060: 61 20 63 6f 72 72 65 63 74 20 4d 44 35 20 63 68 a correct MD5 ch
3070: 65 63 6b 73 75 6d 2e 20 20 41 6e 64 20 61 6c 6c ecksum. And all
3080: 20 63 61 72 64 73 20 6d 75 73 74 0a 62 65 20 69 cards must.be i
3090: 6e 20 73 74 72 69 63 74 20 6c 65 78 69 63 6f 67 n strict lexicog
30a0: 72 61 70 68 69 63 61 6c 20 6f 72 64 65 72 2e 3c raphical order.<
30b0: 2f 70 3e 0a 0a 3c 68 33 3e 33 2e 31 20 54 68 65 /p>..<h3>3.1 The
30c0: 20 55 6e 63 6c 75 73 74 65 72 65 64 20 54 61 62 Unclustered Tab
30d0: 6c 65 3c 2f 68 33 3e 0a 0a 3c 70 3e 45 76 65 72 le</h3>..<p>Ever
30e0: 79 20 72 65 70 6f 73 69 74 6f 72 79 20 6d 61 69 y repository mai
30f0: 6e 74 61 69 6e 73 20 61 20 74 61 62 6c 65 20 6e ntains a table n
3100: 61 6d 65 64 20 22 3c 62 3e 75 6e 63 6c 75 73 74 amed "<b>unclust
3110: 65 72 65 64 3c 2f 62 3e 22 0a 77 68 69 63 68 20 ered</b>".which
3120: 72 65 63 6f 72 64 73 20 74 68 65 20 69 64 65 6e records the iden
3130: 74 69 74 79 20 6f 66 20 65 76 65 72 79 20 66 69 tity of every fi
3140: 6c 65 20 61 6e 64 20 70 68 61 6e 74 6f 6d 20 69 le and phantom i
3150: 74 20 68 6f 6c 64 73 20 74 68 61 74 20 69 73 20 t holds that is
3160: 6e 6f 74 0a 6d 65 6e 74 69 6f 6e 65 64 20 69 6e not.mentioned in
3170: 20 61 20 63 6c 75 73 74 65 72 2e 20 20 54 68 65 a cluster. The
3180: 20 65 6e 74 72 69 65 73 20 69 6e 20 74 68 65 20 entries in the
3190: 75 6e 63 6c 75 73 74 65 72 65 64 20 74 61 62 6c unclustered tabl
31a0: 65 20 63 61 6e 0a 62 65 20 74 68 6f 75 67 68 74 e can.be thought
31b0: 20 6f 66 20 61 73 20 6c 65 61 76 65 73 20 6f 6e of as leaves on
31c0: 20 61 20 74 72 65 65 20 6f 66 20 66 69 6c 65 73 a tree of files
31d0: 2e 20 20 53 6f 6d 65 20 6f 66 20 74 68 65 20 75 . Some of the u
31e0: 6e 63 6c 75 73 74 65 72 65 64 0a 66 69 6c 65 73 nclustered.files
31f0: 20 77 69 6c 6c 20 62 65 20 63 6c 75 73 74 65 72 will be cluster
3200: 73 2e 20 20 54 68 6f 73 65 20 63 6c 75 73 74 65 s. Those cluste
3210: 72 73 20 6d 61 79 20 63 6f 6e 74 61 69 6e 20 6f rs may contain o
3220: 74 68 65 72 20 63 6c 75 73 74 65 72 73 2c 0a 77 ther clusters,.w
3230: 68 69 63 68 20 6d 69 67 68 74 20 63 6f 6e 74 61 hich might conta
3240: 69 6e 20 73 74 69 6c 6c 20 6d 6f 72 65 20 63 6c in still more cl
3250: 75 73 74 65 72 73 2c 20 61 6e 64 20 73 6f 20 66 usters, and so f
3260: 6f 72 74 68 2e 20 20 42 65 67 69 6e 6e 69 6e 67 orth. Beginning
3270: 0a 77 69 74 68 20 74 68 65 20 66 69 6c 65 73 20 .with the files
3280: 69 6e 20 74 68 65 20 75 6e 63 6c 75 73 74 65 72 in the uncluster
3290: 65 64 20 74 61 62 6c 65 2c 20 6f 6e 65 20 63 61 ed table, one ca
32a0: 6e 20 66 6f 6c 6c 6f 77 20 74 68 65 20 63 68 61 n follow the cha
32b0: 69 6e 0a 6f 66 20 63 6c 75 73 74 65 72 73 20 74 in.of clusters t
32c0: 6f 20 66 69 6e 64 20 65 76 65 72 79 20 66 69 6c o find every fil
32d0: 65 20 69 6e 20 74 68 65 20 72 65 70 6f 73 69 74 e in the reposit
32e0: 6f 72 79 2e 3c 2f 70 3e 0a 0a 3c 68 32 3e 34 2e ory.</p>..<h2>4.
32f0: 30 20 53 79 6e 63 68 72 6f 6e 69 7a 61 74 69 6f 0 Synchronizatio
3300: 6e 20 53 74 72 61 74 65 67 69 65 73 3c 2f 68 32 n Strategies</h2
3310: 3e 0a 0a 3c 68 33 3e 34 2e 31 20 50 75 6c 6c 3c >..<h3>4.1 Pull<
3320: 2f 68 33 3e 0a 0a 3c 70 3e 41 20 74 79 70 69 63 /h3>..<p>A typic
3330: 61 6c 20 70 75 6c 6c 20 6f 70 65 72 61 74 69 6f al pull operatio
3340: 6e 20 70 72 6f 63 65 65 64 73 20 61 73 20 73 68 n proceeds as sh
3350: 6f 77 6e 20 62 65 6c 6f 77 2e 20 20 44 65 74 61 own below. Deta
3360: 69 6c 73 0a 6f 66 20 74 68 65 20 61 63 74 75 61 ils.of the actua
3370: 6c 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e l implementation
3380: 20 6d 61 79 20 76 65 72 79 20 73 6c 69 67 68 74 may very slight
3390: 6c 79 20 62 75 74 20 74 68 65 20 67 69 73 74 20 ly but the gist
33a0: 6f 66 0a 61 20 70 75 6c 6c 20 69 73 20 63 61 70 of.a pull is cap
33b0: 74 75 72 65 64 20 69 6e 20 74 68 65 20 66 6f 6c tured in the fol
33c0: 6c 6f 77 69 6e 67 20 73 74 65 70 73 3a 3c 2f 70 lowing steps:</p
33d0: 3e 0a 0a 3c 6f 6c 3e 0a 3c 6c 69 3e 54 68 65 20 >..<ol>.<li>The
33e0: 63 6c 69 65 6e 74 20 73 65 6e 64 73 20 6c 6f 67 client sends log
33f0: 69 6e 20 61 6e 64 20 70 75 6c 6c 20 63 61 72 64 in and pull card
3400: 73 2e 0a 3c 6c 69 3e 54 68 65 20 63 6c 69 65 6e s..<li>The clien
3410: 74 20 73 65 6e 64 73 20 61 20 63 6f 6f 6b 69 65 t sends a cookie
3420: 20 63 61 72 64 20 69 66 20 69 74 20 68 61 73 20 card if it has
3430: 70 72 65 76 69 6f 75 73 6c 79 20 72 65 63 65 69 previously recei
3440: 76 65 64 20 61 20 63 6f 6f 6b 69 65 2e 0a 3c 6c ved a cookie..<l
3450: 69 3e 54 68 65 20 63 6c 69 65 6e 74 20 73 65 6e i>The client sen
3460: 64 73 20 67 69 6d 6d 65 20 63 61 72 64 73 20 66 ds gimme cards f
3470: 6f 72 20 65 76 65 72 79 20 70 68 61 6e 74 6f 6d or every phantom
3480: 20 74 68 61 74 20 69 74 20 68 6f 6c 64 73 2e 0a that it holds..
3490: 3c 68 72 3e 0a 3c 6c 69 3e 54 68 65 20 73 65 72 <hr>.<li>The ser
34a0: 76 65 72 20 63 68 65 63 6b 73 20 74 68 65 20 6c ver checks the l
34b0: 6f 67 69 6e 20 70 61 73 73 77 6f 72 64 20 61 6e ogin password an
34c0: 64 20 72 65 6a 65 63 74 73 20 74 68 65 20 73 65 d rejects the se
34d0: 73 73 69 6f 6e 20 69 66 0a 74 68 65 20 75 73 65 ssion if.the use
34e0: 72 20 64 6f 65 73 20 6e 6f 74 20 68 61 76 65 20 r does not have
34f0: 70 65 72 6d 69 73 73 69 6f 6e 20 74 6f 20 70 75 permission to pu
3500: 6c 6c 2e 0a 3c 6c 69 3e 49 66 20 74 68 65 20 6e ll..<li>If the n
3510: 75 6d 62 65 72 20 65 6e 74 72 69 65 73 20 69 6e umber entries in
3520: 20 74 68 65 20 75 6e 63 6c 75 73 74 65 72 65 64 the unclustered
3530: 20 74 61 62 6c 65 20 6f 6e 20 74 68 65 20 73 65 table on the se
3540: 72 76 65 72 20 69 73 0a 67 72 65 61 74 65 72 20 rver is.greater
3550: 74 68 61 6e 20 31 30 30 2c 20 74 68 65 6e 20 74 than 100, then t
3560: 68 65 20 73 65 72 76 65 72 20 63 6f 6e 73 74 72 he server constr
3570: 75 63 74 73 20 61 20 6e 65 77 20 63 6c 75 73 74 ucts a new clust
3580: 65 72 20 66 69 6c 65 20 74 6f 0a 63 6f 76 65 72 er file to.cover
3590: 20 61 6c 6c 20 74 68 6f 73 65 20 75 6e 63 6c 75 all those unclu
35a0: 73 74 65 72 65 64 20 65 6e 74 72 69 65 73 2e 0a stered entries..
35b0: 3c 6c 69 3e 54 68 65 20 73 65 72 76 65 72 20 73 <li>The server s
35c0: 65 6e 64 73 20 66 69 6c 65 20 63 61 72 64 73 20 ends file cards
35d0: 66 6f 72 20 65 76 65 72 79 20 67 69 6d 6d 65 20 for every gimme
35e0: 63 61 72 64 20 69 74 20 72 65 63 65 69 76 65 64 card it received
35f0: 0a 66 72 6f 6d 20 74 68 65 20 63 6c 69 65 6e 74 .from the client
3600: 2e 0a 3c 6c 69 3e 54 68 65 20 73 65 72 76 65 72 ..<li>The server
3610: 20 73 65 6e 64 73 20 69 68 61 76 65 20 63 61 72 sends ihave car
3620: 64 73 20 66 6f 72 20 65 76 65 72 79 20 66 69 6c ds for every fil
3630: 65 20 69 6e 20 69 74 73 20 75 6e 63 6c 75 73 74 e in its unclust
3640: 65 72 65 64 0a 74 61 62 6c 65 20 74 68 61 74 20 ered.table that
3650: 69 73 20 6e 6f 74 20 61 20 70 68 61 6e 74 6f 6d is not a phantom
3660: 2e 0a 3c 68 72 3e 0a 3c 6c 69 3e 54 68 65 20 63 ..<hr>.<li>The c
3670: 6c 69 65 6e 74 20 61 64 64 73 20 74 68 65 20 63 lient adds the c
3680: 6f 6e 74 65 6e 74 20 6f 66 20 66 69 6c 65 20 63 ontent of file c
3690: 61 72 64 73 20 74 6f 20 69 74 73 20 72 65 70 6f ards to its repo
36a0: 73 69 74 6f 72 79 2e 0a 3c 6c 69 3e 54 68 65 20 sitory..<li>The
36b0: 63 6c 69 65 6e 74 20 63 72 65 61 74 65 73 20 61 client creates a
36c0: 20 70 68 61 6e 74 6f 6d 20 66 6f 72 20 65 76 65 phantom for eve
36d0: 72 79 20 69 68 61 76 65 20 63 61 72 64 20 69 6e ry ihave card in
36e0: 20 74 68 65 20 73 65 72 76 65 72 20 72 65 70 6c the server repl
36f0: 79 0a 74 68 61 74 20 6d 65 6e 74 69 6f 6e 73 20 y.that mentions
3700: 61 20 66 69 6c 65 20 74 68 61 74 20 74 68 65 20 a file that the
3710: 63 6c 69 65 6e 74 20 64 6f 65 73 20 6e 6f 74 20 client does not
3720: 70 6f 73 73 65 73 73 2e 0a 3c 6c 69 3e 54 68 65 possess..<li>The
3730: 20 63 6c 69 65 6e 74 20 63 72 65 61 74 65 73 20 client creates
3740: 61 20 70 68 61 6e 74 6f 6d 20 66 6f 72 20 74 68 a phantom for th
3750: 65 20 64 65 6c 74 61 20 73 6f 75 72 63 65 20 6f e delta source o
3760: 66 20 66 69 6c 65 20 63 61 72 64 73 20 77 68 65 f file cards whe
3770: 6e 0a 74 68 65 20 64 65 6c 74 61 20 73 6f 75 72 n.the delta sour
3780: 63 65 20 69 73 20 61 20 66 69 6c 65 20 74 68 61 ce is a file tha
3790: 74 20 74 68 65 20 63 6c 69 65 6e 74 20 64 6f 65 t the client doe
37a0: 73 20 6e 6f 74 20 70 6f 73 73 65 73 73 2e 0a 3c s not possess..<
37b0: 2f 6f 6c 3e 0a 0a 3c 70 3e 54 68 65 73 65 20 74 /ol>..<p>These t
37c0: 65 6e 20 73 74 65 70 73 20 72 65 70 72 65 73 65 en steps represe
37d0: 6e 74 20 61 20 73 69 6e 67 6c 65 20 48 54 54 50 nt a single HTTP
37e0: 20 72 6f 75 6e 64 2d 74 72 69 70 20 72 65 71 75 round-trip requ
37f0: 65 73 74 2e 0a 54 68 65 20 66 69 72 73 74 20 74 est..The first t
3800: 68 72 65 65 20 73 74 65 70 73 20 61 72 65 20 74 hree steps are t
3810: 68 65 20 70 72 6f 63 65 73 73 69 6e 67 20 74 68 he processing th
3820: 61 74 20 6f 63 63 75 72 73 20 6f 6e 20 74 68 65 at occurs on the
3830: 20 63 6c 69 65 6e 74 0a 74 6f 20 67 65 6e 65 72 client.to gener
3840: 61 74 65 20 74 68 65 20 72 65 71 75 65 73 74 2e ate the request.
3850: 20 20 54 68 65 20 6d 69 64 64 6c 65 20 66 6f 75 The middle fou
3860: 72 20 73 74 65 70 73 20 61 72 65 20 70 72 6f 63 r steps are proc
3870: 65 73 73 69 6e 67 0a 74 68 61 74 20 6f 63 63 75 essing.that occu
3880: 72 73 20 6f 6e 20 74 68 65 20 73 65 72 76 65 72 rs on the server
3890: 20 74 6f 20 69 6e 74 65 72 70 72 65 74 20 74 68 to interpret th
38a0: 65 20 72 65 71 75 65 73 74 20 61 6e 64 20 67 65 e request and ge
38b0: 6e 65 72 61 74 65 20 61 0a 72 65 70 6c 79 2e 20 nerate a.reply.
38c0: 20 41 6e 64 20 74 68 65 20 6c 61 73 74 20 74 68 And the last th
38d0: 72 65 65 20 73 74 65 70 73 20 61 72 65 20 74 68 ree steps are th
38e0: 65 20 70 72 6f 63 65 73 73 69 6e 67 20 74 68 61 e processing tha
38f0: 74 20 74 68 65 0a 63 6c 69 65 6e 74 20 64 6f 65 t the.client doe
3900: 73 20 74 6f 20 69 6e 74 65 72 70 72 65 74 20 74 s to interpret t
3910: 68 65 20 72 65 70 6c 79 2e 3c 2f 70 3e 0a 0a 3c he reply.</p>..<
3920: 70 3e 44 75 72 69 6e 67 20 61 20 70 75 6c 6c 2c p>During a pull,
3930: 20 74 68 65 20 63 6c 69 65 6e 74 20 77 69 6c 6c the client will
3940: 20 6b 65 65 70 20 73 65 6e 64 69 6e 67 20 48 54 keep sending HT
3950: 54 50 20 72 65 71 75 65 73 74 73 0a 75 6e 74 69 TP requests.unti
3960: 6c 20 69 74 20 68 6f 6c 64 73 20 61 6c 6c 20 66 l it holds all f
3970: 69 6c 65 73 20 74 68 61 74 20 65 78 69 73 74 20 iles that exist
3980: 6f 6e 20 74 68 65 20 73 65 72 76 65 72 2e 3c 2f on the server.</
3990: 70 3e 0a 0a 3c 70 3e 4e 6f 74 65 20 74 68 61 74 p>..<p>Note that
39a0: 20 74 68 65 20 73 65 72 76 65 72 20 74 72 69 65 the server trie
39b0: 73 0a 74 6f 20 6c 69 6d 69 74 20 74 68 65 20 73 s.to limit the s
39c0: 69 7a 65 20 6f 66 20 69 74 73 20 72 65 70 6c 79 ize of its reply
39d0: 20 6d 65 73 73 61 67 65 20 74 6f 20 73 6f 6d 65 message to some
39e0: 74 68 69 6e 67 20 72 65 61 73 6f 6e 61 62 6c 65 thing reasonable
39f0: 0a 28 75 73 75 61 6c 6c 79 20 61 62 6f 75 74 20 .(usually about
3a00: 31 4d 42 29 20 73 6f 20 74 68 61 74 20 69 74 20 1MB) so that it
3a10: 6d 69 67 68 74 20 73 74 6f 70 20 73 65 6e 64 69 might stop sendi
3a20: 6e 67 20 66 69 6c 65 20 63 61 72 64 73 20 61 73 ng file cards as
3a30: 0a 64 65 73 63 72 69 62 65 64 20 69 6e 20 73 74 .described in st
3a40: 65 70 20 28 36 29 20 69 66 20 74 68 65 20 72 65 ep (6) if the re
3a50: 70 6c 79 20 62 65 63 6f 6d 65 73 20 74 6f 6f 20 ply becomes too
3a60: 6c 61 72 67 65 2e 3c 2f 70 3e 0a 0a 3c 70 3e 53 large.</p>..<p>S
3a70: 74 65 70 20 28 35 29 20 69 73 20 74 68 65 20 6f tep (5) is the o
3a80: 6e 6c 79 20 77 61 79 20 69 6e 20 77 68 69 63 68 nly way in which
3a90: 20 6e 65 77 20 63 6c 75 73 74 65 72 73 20 63 61 new clusters ca
3aa0: 6e 20 62 65 20 63 72 65 61 74 65 64 2e 0a 42 79 n be created..By
3ab0: 20 6f 6e 6c 79 20 63 72 65 61 74 69 6e 67 20 63 only creating c
3ac0: 6c 75 73 74 65 72 73 20 6f 6e 20 74 68 65 20 73 lusters on the s
3ad0: 65 72 76 65 72 2c 20 77 65 20 68 6f 70 65 20 74 erver, we hope t
3ae0: 6f 20 6d 69 6e 69 6d 69 7a 65 20 74 68 65 0a 61 o minimize the.a
3af0: 6d 6f 75 6e 74 20 6f 66 20 6f 76 65 72 6c 61 70 mount of overlap
3b00: 20 62 65 74 77 65 65 6e 20 63 6c 75 73 74 65 72 between cluster
3b10: 73 20 69 6e 20 74 68 65 20 63 6f 6d 6d 6f 6e 20 s in the common
3b20: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 77 68 configuration wh
3b30: 65 72 65 0a 74 68 65 72 65 20 69 73 20 61 20 73 ere.there is a s
3b40: 69 6e 67 6c 65 20 73 65 72 76 65 72 20 61 6e 64 ingle server and
3b50: 20 6d 61 6e 79 20 63 6c 69 65 6e 74 73 2e 20 20 many clients.
3b60: 54 68 65 20 73 61 6d 65 20 73 79 6e 63 68 72 6f The same synchro
3b70: 6e 69 7a 61 74 69 6f 6e 0a 70 72 6f 74 6f 63 6f nization.protoco
3b80: 6c 20 77 69 6c 6c 20 63 6f 6e 74 69 6e 75 65 20 l will continue
3b90: 74 6f 20 77 6f 72 6b 20 65 76 65 6e 20 69 66 20 to work even if
3ba0: 74 68 65 72 65 20 61 72 65 20 6d 75 6c 74 69 70 there are multip
3bb0: 6c 65 20 73 65 72 76 65 72 73 0a 6f 72 20 69 66 le servers.or if
3bc0: 20 73 65 72 76 65 72 73 20 61 6e 64 20 63 6c 69 servers and cli
3bd0: 65 6e 74 73 20 73 6f 6d 65 74 69 6d 65 73 20 63 ents sometimes c
3be0: 68 61 6e 67 65 20 72 6f 6c 65 73 2e 20 20 54 68 hange roles. Th
3bf0: 65 20 6f 6e 6c 79 20 6e 65 67 61 74 69 76 65 0a e only negative.
3c00: 65 66 66 65 63 74 73 20 6f 66 20 74 68 65 73 65 effects of these
3c10: 20 75 6e 75 73 75 61 6c 20 61 72 72 61 6e 67 65 unusual arrange
3c20: 6d 65 6e 74 73 20 69 73 20 74 68 61 74 20 6d 6f ments is that mo
3c30: 72 65 20 74 68 61 6e 20 74 68 65 20 6d 69 6e 69 re than the mini
3c40: 6d 75 6d 0a 6e 75 6d 62 65 72 20 6f 66 20 63 6c mum.number of cl
3c50: 75 73 74 65 72 73 20 6d 69 67 68 74 20 62 65 20 usters might be
3c60: 67 65 6e 65 72 61 74 65 64 2e 3c 2f 70 3e 0a 0a generated.</p>..
3c70: 3c 68 33 3e 34 2e 32 20 50 75 73 68 3c 2f 68 33 <h3>4.2 Push</h3
3c80: 3e 0a 0a 3c 70 3e 41 20 74 79 70 69 63 61 6c 20 >..<p>A typical
3c90: 70 75 73 68 20 6f 70 65 72 61 74 69 6f 6e 20 70 push operation p
3ca0: 72 6f 63 65 65 64 73 20 72 6f 75 67 68 6c 79 20 roceeds roughly
3cb0: 61 73 20 73 68 6f 77 6e 20 62 65 6c 6f 77 2e 20 as shown below.
3cc0: 20 41 73 0a 77 69 74 68 20 61 20 70 75 6c 6c 2c As.with a pull,
3cd0: 20 74 68 65 20 61 63 74 75 61 6c 20 69 6d 70 6c the actual impl
3ce0: 65 6d 65 6e 74 61 74 69 6f 6e 20 6d 61 79 20 76 ementation may v
3cf0: 61 72 79 20 73 6c 69 67 68 74 6c 79 2e 3c 2f 70 ary slightly.</p
3d00: 3e 0a 0a 3c 6f 6c 3e 0a 3c 6c 69 3e 54 68 65 20 >..<ol>.<li>The
3d10: 63 6c 69 65 6e 74 20 73 65 6e 64 73 20 6c 6f 67 client sends log
3d20: 69 6e 20 61 6e 64 20 70 75 73 68 20 63 61 72 64 in and push card
3d30: 73 2e 0a 3c 6c 69 3e 54 68 65 20 63 6c 69 65 6e s..<li>The clien
3d40: 74 20 73 65 6e 64 73 20 66 69 6c 65 20 63 61 72 t sends file car
3d50: 64 73 20 66 6f 72 20 61 6e 79 20 66 69 6c 65 73 ds for any files
3d60: 20 74 68 61 74 20 69 74 20 68 6f 6c 64 73 20 74 that it holds t
3d70: 68 61 74 20 68 61 76 65 0a 6e 65 76 65 72 20 62 hat have.never b
3d80: 65 66 6f 72 65 20 62 65 65 6e 20 70 75 73 68 65 efore been pushe
3d90: 64 20 2d 20 66 69 6c 65 73 20 74 68 61 74 20 63 d - files that c
3da0: 6f 6d 65 20 66 72 6f 6d 20 6c 6f 63 61 6c 20 63 ome from local c
3db0: 68 65 63 6b 2d 69 6e 73 2e 0a 3c 6c 69 3e 49 66 heck-ins..<li>If
3dc0: 20 74 68 69 73 20 69 73 20 74 68 65 20 73 65 63 this is the sec
3dd0: 6f 6e 64 20 6f 72 20 6c 61 74 65 72 20 63 79 63 ond or later cyc
3de0: 6c 65 20 69 6e 20 61 20 70 75 73 68 2c 20 74 68 le in a push, th
3df0: 65 6e 20 74 68 65 0a 63 6c 69 65 6e 74 20 73 65 en the.client se
3e00: 6e 64 73 20 66 69 6c 65 20 63 61 72 64 73 20 66 nds file cards f
3e10: 6f 72 20 61 6e 79 20 67 69 6d 6d 65 20 63 61 72 or any gimme car
3e20: 64 73 20 74 68 61 74 20 74 68 65 20 73 65 72 76 ds that the serv
3e30: 65 72 20 73 65 6e 74 0a 69 6e 20 74 68 65 20 70 er sent.in the p
3e40: 72 65 76 69 6f 75 73 20 63 79 63 6c 65 2e 0a 3c revious cycle..<
3e50: 6c 69 3e 54 68 65 20 63 6c 69 65 6e 74 20 73 65 li>The client se
3e60: 6e 64 73 20 69 67 6f 74 20 63 61 72 64 73 20 66 nds igot cards f
3e70: 6f 72 20 65 76 65 72 79 20 66 69 6c 65 20 69 6e or every file in
3e80: 20 69 74 73 20 75 6e 63 6c 75 73 74 65 72 65 64 its unclustered
3e90: 20 74 61 62 6c 65 0a 74 68 61 74 20 69 73 20 6e table.that is n
3ea0: 6f 74 20 61 20 70 68 61 6e 74 6f 6d 2e 0a 3c 68 ot a phantom..<h
3eb0: 72 3e 0a 3c 6c 69 3e 54 68 65 20 73 65 72 76 65 r>.<li>The serve
3ec0: 72 20 63 68 65 63 6b 73 20 74 68 65 20 6c 6f 67 r checks the log
3ed0: 69 6e 20 61 6e 64 20 70 75 73 68 20 63 61 72 64 in and push card
3ee0: 73 20 61 6e 64 20 69 73 73 75 65 73 20 61 6e 20 s and issues an
3ef0: 65 72 72 6f 72 20 69 66 0a 61 6e 79 74 68 69 6e error if.anythin
3f00: 67 20 69 73 20 61 6d 69 73 73 2e 0a 3c 6c 69 3e g is amiss..<li>
3f10: 54 68 65 20 73 65 72 76 65 72 20 61 63 63 65 70 The server accep
3f20: 74 73 20 66 69 6c 65 20 63 61 72 64 73 20 66 72 ts file cards fr
3f30: 6f 6d 20 74 68 65 20 63 6c 69 65 6e 74 20 61 6e om the client an
3f40: 64 20 61 64 64 73 20 74 68 6f 73 65 20 66 69 6c d adds those fil
3f50: 65 73 0a 74 6f 20 69 74 73 20 72 65 70 6f 73 69 es.to its reposi
3f60: 74 6f 72 79 2e 0a 3c 6c 69 3e 54 68 65 20 73 65 tory..<li>The se
3f70: 72 76 65 72 20 63 72 65 61 74 65 73 20 70 68 61 rver creates pha
3f80: 6e 74 6f 6d 73 20 66 6f 72 20 69 67 6f 74 20 63 ntoms for igot c
3f90: 61 72 64 73 20 74 68 61 74 20 6d 65 6e 74 69 6f ards that mentio
3fa0: 6e 20 66 69 6c 65 73 20 69 74 0a 64 6f 65 73 20 n files it.does
3fb0: 6e 6f 74 20 70 6f 73 73 65 73 73 20 6f 72 20 66 not possess or f
3fc0: 6f 72 20 66 69 6c 65 20 63 61 72 64 73 20 74 68 or file cards th
3fd0: 61 74 20 6d 65 6e 74 69 6f 6e 20 64 65 6c 74 61 at mention delta
3fe0: 20 73 6f 75 72 63 65 20 66 69 6c 65 73 20 74 68 source files th
3ff0: 61 74 0a 69 74 20 64 6f 65 73 20 6e 6f 74 20 70 at.it does not p
4000: 6f 73 73 65 73 73 2e 0a 3c 6c 69 3e 54 68 65 20 ossess..<li>The
4010: 73 65 72 76 65 72 20 69 73 73 75 65 73 20 67 69 server issues gi
4020: 6d 6d 65 20 63 61 72 64 73 20 66 6f 72 20 61 6c mme cards for al
4030: 6c 20 70 68 61 6e 74 6f 6d 73 2e 0a 3c 68 72 3e l phantoms..<hr>
4040: 0a 3c 6c 69 3e 54 68 65 20 63 6c 69 65 6e 74 20 .<li>The client
4050: 72 65 6d 65 6d 62 65 72 73 20 74 68 65 20 67 69 remembers the gi
4060: 6d 6d 65 20 63 61 72 64 73 20 66 72 6f 6d 20 74 mme cards from t
4070: 68 65 20 73 65 72 76 65 72 20 73 6f 20 74 68 61 he server so tha
4080: 74 20 69 74 0a 63 61 6e 20 67 65 6e 65 72 61 74 t it.can generat
4090: 65 20 66 69 6c 65 20 63 61 72 64 73 20 69 6e 20 e file cards in
40a0: 72 65 70 6c 79 20 6f 6e 20 74 68 65 20 6e 65 78 reply on the nex
40b0: 74 20 63 79 63 6c 65 2e 0a 3c 2f 6f 6c 3e 0a 0a t cycle..</ol>..
40c0: 3c 70 3e 41 73 20 77 69 74 68 20 61 20 70 75 6c <p>As with a pul
40d0: 6c 2c 20 74 68 65 20 73 74 65 70 73 20 6f 66 20 l, the steps of
40e0: 61 20 70 75 73 68 20 6f 70 65 72 61 74 69 6f 6e a push operation
40f0: 20 72 65 70 65 61 74 20 75 6e 74 69 6c 20 74 68 repeat until th
4100: 65 0a 73 65 72 76 65 72 20 6b 6e 6f 77 73 20 61 e.server knows a
4110: 6c 6c 20 66 69 6c 65 73 20 74 68 61 74 20 65 78 ll files that ex
4120: 69 73 74 20 6f 6e 20 74 68 65 20 63 6c 69 65 6e ist on the clien
4130: 74 2e 20 20 41 6c 73 6f 2c 20 61 73 20 77 69 74 t. Also, as wit
4140: 68 0a 70 75 6c 6c 2c 20 74 68 65 20 63 6c 69 65 h.pull, the clie
4150: 6e 74 20 61 74 74 65 6d 70 74 73 20 74 6f 20 6b nt attempts to k
4160: 65 65 70 20 74 68 65 20 73 69 7a 65 20 6f 66 20 eep the size of
4170: 74 68 65 20 72 65 71 75 65 73 74 20 66 72 6f 6d the request from
4180: 0a 67 72 6f 77 69 6e 67 20 74 6f 6f 20 6c 61 72 .growing too lar
4190: 67 65 20 62 79 20 73 75 70 70 72 65 73 73 69 6e ge by suppressin
41a0: 67 20 66 69 6c 65 20 63 61 72 64 73 20 6f 6e 63 g file cards onc
41b0: 65 20 74 68 65 0a 73 69 7a 65 20 6f 66 20 74 68 e the.size of th
41c0: 65 20 72 65 71 75 65 73 74 20 72 65 61 63 68 65 e request reache
41d0: 73 20 31 4d 42 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e s 1MB.</p>..<h3>
41e0: 34 2e 33 20 53 79 6e 63 3c 2f 68 33 3e 0a 0a 3c 4.3 Sync</h3>..<
41f0: 70 3e 41 20 73 79 6e 63 20 69 73 20 6a 75 73 74 p>A sync is just
4200: 20 61 20 70 75 6c 6c 20 61 6e 64 20 61 20 70 75 a pull and a pu
4210: 73 68 20 74 68 61 74 20 68 61 70 70 65 6e 20 61 sh that happen a
4220: 74 20 74 68 65 20 73 61 6d 65 20 74 69 6d 65 2e t the same time.
4230: 0a 54 68 65 20 66 69 72 73 74 20 74 68 72 65 65 .The first three
4240: 20 73 74 65 70 73 20 6f 66 20 61 20 70 75 6c 6c steps of a pull
4250: 20 61 72 65 20 63 6f 6d 62 69 6e 65 64 20 77 69 are combined wi
4260: 74 68 20 74 68 65 20 66 69 72 73 74 20 66 69 76 th the first fiv
4270: 65 20 73 74 65 70 73 0a 6f 66 20 61 20 70 75 73 e steps.of a pus
4280: 68 2e 20 20 53 74 65 70 73 20 28 34 29 20 74 68 h. Steps (4) th
4290: 72 6f 75 67 68 20 28 37 29 20 6f 66 20 61 20 70 rough (7) of a p
42a0: 75 6c 6c 20 61 72 65 20 63 6f 6d 62 69 6e 65 64 ull are combined
42b0: 20 77 69 74 68 20 73 74 65 70 73 0a 28 35 29 20 with steps.(5)
42c0: 74 68 72 6f 75 67 68 20 28 38 29 20 6f 66 20 61 through (8) of a
42d0: 20 70 75 73 68 2e 20 20 41 6e 64 20 73 74 65 70 push. And step
42e0: 73 20 28 38 29 20 74 68 72 6f 75 67 68 20 28 31 s (8) through (1
42f0: 30 29 20 6f 66 20 61 20 70 75 6c 6c 0a 61 72 65 0) of a pull.are
4300: 20 63 6f 6d 62 69 6e 65 64 20 77 69 74 68 20 73 combined with s
4310: 74 65 70 20 28 39 29 20 6f 66 20 61 20 70 75 73 tep (9) of a pus
4320: 68 2e 3c 2f 70 3e 0a 0a 3c 68 32 3e 35 2e 30 20 h.</p>..<h2>5.0
4330: 53 75 6d 6d 61 72 79 3c 2f 68 32 3e 0a 0a 3c 70 Summary</h2>..<p
4340: 3e 48 65 72 65 20 61 72 65 20 74 68 65 20 6b 65 >Here are the ke
4350: 79 20 70 6f 69 6e 74 73 20 6f 66 20 74 68 65 20 y points of the
4360: 73 79 6e 63 68 72 6f 6e 69 7a 61 74 69 6f 6e 20 synchronization
4370: 70 72 6f 74 6f 63 6f 6c 3a 3c 2f 70 3e 0a 0a 3c protocol:</p>..<
4380: 6f 6c 3e 0a 3c 6c 69 3e 54 68 65 20 63 6c 69 65 ol>.<li>The clie
4390: 6e 74 20 73 65 6e 64 73 20 6f 6e 65 20 6f 72 20 nt sends one or
43a0: 6d 6f 72 65 20 50 55 53 48 20 48 54 54 50 20 72 more PUSH HTTP r
43b0: 65 71 75 65 73 74 73 20 74 6f 20 74 68 65 20 73 equests to the s
43c0: 65 72 76 65 72 2e 0a 20 20 20 20 54 68 65 20 72 erver.. The r
43d0: 65 71 75 65 73 74 20 61 6e 64 20 72 65 70 6c 79 equest and reply
43e0: 20 63 6f 6e 74 65 6e 74 20 74 79 70 65 20 69 73 content type is
43f0: 20 22 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 2d "application/x-
4400: 66 6f 73 73 69 6c 22 2e 0a 3c 6c 69 3e 48 54 54 fossil"..<li>HTT
4410: 50 20 72 65 71 75 65 73 74 20 63 6f 6e 74 65 6e P request conten
4420: 74 20 69 73 20 63 6f 6d 70 72 65 73 73 65 64 20 t is compressed
4430: 75 73 69 6e 67 20 7a 6c 69 62 2e 0a 3c 6c 69 3e using zlib..<li>
4440: 54 68 65 20 63 6f 6e 74 65 6e 74 20 6f 66 20 72 The content of r
4450: 65 71 75 65 73 74 20 61 6e 64 20 72 65 70 6c 79 equest and reply
4460: 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 63 61 72 consists of car
4470: 64 73 20 77 69 74 68 20 6f 6e 65 0a 20 20 20 20 ds with one.
4480: 63 61 72 64 20 70 65 72 20 6c 69 6e 65 2e 20 20 card per line.
4490: 0a 3c 6c 69 3e 43 61 72 64 20 66 6f 72 6d 61 74 .<li>Card format
44a0: 73 20 61 72 65 3a 0a 20 20 20 20 3c 75 6c 3e 0a s are:. <ul>.
44b0: 20 20 20 20 3c 6c 69 3e 20 3c 62 3e 6c 6f 67 69 <li> <b>logi
44c0: 6e 3c 2f 62 3e 20 3c 69 3e 75 73 65 72 69 64 20 n</b> <i>userid
44d0: 6e 6f 6e 63 65 20 73 69 67 6e 61 74 75 72 65 3c nonce signature<
44e0: 2f 69 3e 0a 20 20 20 20 3c 6c 69 3e 20 3c 62 3e /i>. <li> <b>
44f0: 70 75 73 68 3c 2f 62 3e 20 3c 69 3e 73 65 72 76 push</b> <i>serv
4500: 65 72 63 6f 64 65 20 70 72 6f 6a 65 63 74 63 6f ercode projectco
4510: 64 65 3c 2f 69 3e 0a 20 20 20 20 3c 6c 69 3e 20 de</i>. <li>
4520: 3c 62 3e 70 75 6c 6c 3c 2f 62 3e 20 3c 69 3e 73 <b>pull</b> <i>s
4530: 65 72 76 65 72 63 6f 64 65 20 70 72 6f 6a 65 63 ervercode projec
4540: 74 63 6f 64 65 3c 2f 69 3e 0a 20 20 20 20 3c 6c tcode</i>. <l
4550: 69 3e 20 3c 62 3e 63 6c 6f 6e 65 3c 2f 62 3e 0a i> <b>clone</b>.
4560: 20 20 20 20 3c 6c 69 3e 20 3c 62 3e 66 69 6c 65 <li> <b>file
4570: 3c 2f 62 3e 20 3c 69 3e 75 75 69 64 20 73 69 7a </b> <i>uuid siz
4580: 65 3c 2f 69 3e 20 3c 62 3e 5c 6e 3c 2f 62 3e 20 e</i> <b>\n</b>
4590: 3c 69 3e 63 6f 6e 74 65 6e 74 3c 2f 69 3e 0a 20 <i>content</i>.
45a0: 20 20 20 3c 6c 69 3e 20 3c 62 3e 66 69 6c 65 3c <li> <b>file<
45b0: 2f 62 3e 20 3c 69 3e 75 75 69 64 20 64 65 6c 74 /b> <i>uuid delt
45c0: 61 2d 75 75 69 64 20 73 69 7a 65 3c 2f 69 3e 20 a-uuid size</i>
45d0: 3c 62 3e 5c 6e 3c 2f 62 3e 20 3c 69 3e 63 6f 6e <b>\n</b> <i>con
45e0: 74 65 6e 74 3c 2f 69 3e 0a 20 20 20 20 3c 6c 69 tent</i>. <li
45f0: 3e 20 3c 62 3e 69 67 6f 74 3c 2f 62 3e 20 3c 69 > <b>igot</b> <i
4600: 3e 75 75 69 64 3c 2f 69 3e 0a 20 20 20 20 3c 6c >uuid</i>. <l
4610: 69 3e 20 3c 62 3e 67 69 6d 6d 65 3c 2f 62 3e 20 i> <b>gimme</b>
4620: 3c 69 3e 75 75 69 64 3c 2f 69 3e 0a 20 20 20 20 <i>uuid</i>.
4630: 3c 6c 69 3e 20 3c 62 3e 63 6f 6f 6b 69 65 3c 2f <li> <b>cookie</
4640: 62 3e 20 20 3c 69 3e 63 6f 6f 6b 69 65 2d 74 65 b> <i>cookie-te
4650: 78 74 3c 2f 69 3e 0a 20 20 20 20 3c 6c 69 3e 20 xt</i>. <li>
4660: 3c 62 3e 65 72 72 6f 72 3c 2f 62 3e 20 3c 69 3e <b>error</b> <i>
4670: 65 72 72 6f 72 2d 6d 65 73 73 61 67 65 3c 2f 69 error-message</i
4680: 3e 0a 20 20 20 20 3c 2f 75 6c 3e 0a 3c 6c 69 3e >. </ul>.<li>
4690: 50 68 61 6e 74 6f 6d 73 20 61 72 65 20 66 69 6c Phantoms are fil
46a0: 65 73 20 74 68 61 74 20 61 20 72 65 70 6f 73 69 es that a reposi
46b0: 74 6f 72 79 20 6b 6e 6f 77 73 20 65 78 69 73 74 tory knows exist
46c0: 20 62 75 74 20 64 6f 65 73 20 6e 6f 74 20 70 6f but does not po
46d0: 73 73 65 73 73 2e 0a 3c 6c 69 3e 43 6c 75 73 74 ssess..<li>Clust
46e0: 65 72 73 20 61 72 65 20 66 69 6c 65 73 20 74 68 ers are files th
46f0: 61 74 20 63 6f 6e 74 61 69 6e 20 74 68 65 20 55 at contain the U
4700: 55 49 44 73 20 6f 66 20 6f 74 68 65 72 20 66 69 UIDs of other fi
4710: 6c 65 73 2e 0a 3c 6c 69 3e 43 6c 75 73 74 65 72 les..<li>Cluster
4720: 73 20 61 72 65 20 63 72 65 61 74 65 64 20 61 75 s are created au
4730: 74 6f 6d 61 74 69 63 61 6c 6c 79 20 6f 6e 20 74 tomatically on t
4740: 68 65 20 73 65 72 76 65 72 20 64 75 72 69 6e 67 he server during
4750: 20 61 20 70 75 6c 6c 2e 0a 3c 6c 69 3e 52 65 70 a pull..<li>Rep
4760: 6f 73 69 74 6f 72 69 65 73 20 6b 65 65 70 20 74 ositories keep t
4770: 72 61 63 6b 20 6f 66 20 61 6c 6c 20 66 69 6c 65 rack of all file
4780: 73 20 74 68 61 74 20 61 72 65 20 6e 6f 74 20 6e s that are not n
4790: 61 6d 65 64 20 69 6e 20 61 6e 79 0a 63 6c 75 73 amed in any.clus
47a0: 74 65 72 20 61 6e 64 20 73 65 6e 64 20 69 67 6f ter and send igo
47b0: 74 20 6d 65 73 73 61 67 65 73 20 66 6f 72 20 74 t messages for t
47c0: 68 6f 73 65 20 66 69 6c 65 73 2e 0a 3c 6c 69 3e hose files..<li>
47d0: 52 65 70 6f 73 69 74 6f 72 69 65 73 20 6b 65 65 Repositories kee
47e0: 70 20 74 72 61 63 6b 20 6f 66 20 61 6c 6c 20 74 p track of all t
47f0: 68 65 20 70 68 61 6e 74 6f 6d 73 20 74 68 65 79 he phantoms they
4800: 20 68 6f 6c 64 20 61 6e 64 20 73 65 6e 64 0a 67 hold and send.g
4810: 69 6d 6d 65 20 6d 65 73 73 61 67 65 73 20 66 6f imme messages fo
4820: 72 20 74 68 6f 73 65 20 66 69 6c 65 73 2e 0a 3c r those files..<
4830: 2f 6f 6c 3e 0a /ol>.