From c207d7ec625a74b4406934a88922108b4b993b28 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Wed, 19 Jan 2005 20:10:50 +0000 Subject: [PATCH] Moved write_sum_head() here from generator.c. --- io.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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. -- 2.34.1