=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rsync/blocks.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** src/usr.bin/rsync/blocks.c 2019/02/10 23:18:28 1.1 --- src/usr.bin/rsync/blocks.c 2019/02/10 23:24:14 1.2 *************** *** 1,4 **** ! /* $Id: blocks.c,v 1.1 2019/02/10 23:18:28 benno Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: blocks.c,v 1.2 2019/02/10 23:24:14 benno Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * *************** *** 161,167 **** blk_match_send(struct sess *sess, const char *path, int fd, const void *buf, off_t size, const struct blkset *blks) { ! off_t offs, last, end, fromcopy = 0, fromdown = 0, total = 0, sz; int32_t tok; struct blk *blk; --- 161,167 ---- blk_match_send(struct sess *sess, const char *path, int fd, const void *buf, off_t size, const struct blkset *blks) { ! off_t offs, last, end, fromcopy = 0, fromdown = 0, total = 0, sz; int32_t tok; struct blk *blk; *************** *** 238,244 **** blk_match(struct sess *sess, int fd, const struct blkset *blks, const char *path) { ! int nfd, rc = 0, c; struct stat st; void *map = MAP_FAILED; size_t mapsz; --- 238,244 ---- blk_match(struct sess *sess, int fd, const struct blkset *blks, const char *path) { ! int nfd, rc = 0, c; struct stat st; void *map = MAP_FAILED; size_t mapsz; *************** *** 293,299 **** "upload ratio", path, (intmax_t)st.st_size); } ! /* * Now write the full file hash. * Since we're seeding the hash, this always gives us some sort * of data even if the file's zero-length. --- 293,299 ---- "upload ratio", path, (intmax_t)st.st_size); } ! /* * Now write the full file hash. * Since we're seeding the hash, this always gives us some sort * of data even if the file's zero-length. *************** *** 408,414 **** } } ! /* * Read each block individually. * FIXME: read buffer and unbuffer. */ --- 408,414 ---- } } ! /* * Read each block individually. * FIXME: read buffer and unbuffer. */ *************** *** 635,647 **** /* Put the entire send routine into a buffer. */ sz = sizeof(int32_t) + /* identifier */ ! sizeof(int32_t) + /* block count */ ! sizeof(int32_t) + /* block length */ ! sizeof(int32_t) + /* checksum length */ ! sizeof(int32_t) + /* block remainder */ ! p->blksz * ! (sizeof(int32_t) + /* short checksum */ ! p->csum); /* long checksum */ if (NULL == (buf = malloc(sz))) { ERR(sess, "malloc"); --- 635,647 ---- /* Put the entire send routine into a buffer. */ sz = sizeof(int32_t) + /* identifier */ ! sizeof(int32_t) + /* block count */ ! sizeof(int32_t) + /* block length */ ! sizeof(int32_t) + /* checksum length */ ! sizeof(int32_t) + /* block remainder */ ! p->blksz * ! (sizeof(int32_t) + /* short checksum */ ! p->csum); /* long checksum */ if (NULL == (buf = malloc(sz))) { ERR(sess, "malloc"); *************** *** 655,663 **** io_buffer_int(sess, buf, &pos, sz, p->rem); for (i = 0; i < p->blksz; i++) { ! io_buffer_int(sess, buf, &pos, sz, p->blks[i].chksum_short); ! io_buffer_buf(sess, buf, &pos, sz, p->blks[i].chksum_long, p->csum); } --- 655,663 ---- io_buffer_int(sess, buf, &pos, sz, p->rem); for (i = 0; i < p->blksz; i++) { ! io_buffer_int(sess, buf, &pos, sz, p->blks[i].chksum_short); ! io_buffer_buf(sess, buf, &pos, sz, p->blks[i].chksum_long, p->csum); }