X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/188fed9570d7a5cb5c28f259c3be85437bc10cc6..027428eb1d7524815d9b29f825033d7902258db5:/io.c diff --git a/io.c b/io.c index 762cf814..e2dc152a 100644 --- a/io.c +++ b/io.c @@ -804,6 +804,23 @@ void read_sum_head(int f, struct sum_struct *sum) } } +/* Send the values from a sum_struct over the socket. Set sum to + * NULL if there are no checksums to send. This is called by both + * the generator and the sender. */ +void write_sum_head(int f, struct sum_struct *sum) +{ + static struct sum_struct null_sum; + + if (sum == NULL) + sum = &null_sum; + + write_int(f, sum->count); + write_int(f, sum->blength); + if (protocol_version >= 27) + write_int(f, sum->s2length); + write_int(f, sum->remainder); +} + /** * Sleep after writing to limit I/O bandwidth usage.