aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2005-01-19 20:10:50 +0000
committerWayne Davison <wayned@samba.org>2005-01-19 20:10:50 +0000
commitc207d7ec625a74b4406934a88922108b4b993b28 (patch)
tree61b7375960eab47461cc082f5c771ff15d89708d /io.c
parent018b28328c7ac0f4f99739d7dff13aa2f32b853d (diff)
downloadandroid_external_rsync-c207d7ec625a74b4406934a88922108b4b993b28.tar.gz
android_external_rsync-c207d7ec625a74b4406934a88922108b4b993b28.tar.bz2
android_external_rsync-c207d7ec625a74b4406934a88922108b4b993b28.zip
Moved write_sum_head() here from generator.c.
Diffstat (limited to 'io.c')
-rw-r--r--io.c17
1 files changed, 17 insertions, 0 deletions
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.