diff options
| author | Wayne Davison <wayned@samba.org> | 2005-01-19 20:10:50 +0000 |
|---|---|---|
| committer | Wayne Davison <wayned@samba.org> | 2005-01-19 20:10:50 +0000 |
| commit | c207d7ec625a74b4406934a88922108b4b993b28 (patch) | |
| tree | 61b7375960eab47461cc082f5c771ff15d89708d /io.c | |
| parent | 018b28328c7ac0f4f99739d7dff13aa2f32b853d (diff) | |
| download | android_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.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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. |
