Switchable protocol layers for librsync --------------------------------------- $Id: protocol-layer.txt,v 1.1 2001/03/11 07:57:14 mbp Exp $ Tridge suggested it might be nice to allow librsync to support multiple switchable protocols. Example interesting protocols are: * my librsync protocol * real gdiff * whatever HTTP Delta uses (VDELTA?) * ed scripts There are a couple of complications here. In ed scripts, we need to specify a series of transformations to apply to the input file, rather than constructing the output while looking at the input. This is similar, but not quite the same as in-place updates. At the moment I'd suspect we would also need a separate encoding machine, and not just new routines called by the encoder. Perhaps not. Of course ed also has to work on line boundaries, not byte or block boundaries. So that would mean counting our location, and rounding out literal insertions to whole lines. ed is probably not terribly useful, but it's an interesting thought experiment. VDELTA seems to have a very complicated encoding format, to try to do deltas and compression in one go. Old librsync should be straightforward, since it uses the same concepts as we do, and only works in 4-byte ints and byte literals. We will need to work in bytes, not blocks, though. Simply using a vtable of callbacks for encoding formats will have some complications because we have to do nonblocking reads. I guess perhaps they can just return rs_results.