new exit/cleanup code
[rsync/rsync.git] / match.c
diff --git a/match.c b/match.c
index ee22ca3..3cd489d 100644 (file)
--- a/match.c
+++ b/match.c
@@ -19,6 +19,8 @@
 
 #include "rsync.h"
 
+extern int csum_length;
+
 extern int verbose;
 extern int am_server;
 
@@ -101,7 +103,7 @@ static void matched(int f,struct sum_struct *s,char *buf,off_t len,
     int l = 0;
     write_int(f,n);
     while (l < n) {
-      int n1 = MIN(WRITE_BLOCK_SIZE,n-l);
+      int n1 = MIN(CHUNK_SIZE,n-l);
       write_buf(f,map_ptr(buf,last_match+l,n1),n1);
       l += n1;
     }
@@ -170,7 +172,7 @@ static void hash_search(int f,struct sum_struct *s,char *buf,off_t len)
            get_checksum2(map,l,sum2);
            done_csum2 = 1;
          }
-         if (memcmp(sum2,s->sums[i].sum2,SUM_LENGTH) == 0) {
+         if (memcmp(sum2,s->sums[i].sum2,csum_length) == 0) {
            matched(f,s,buf,len,offset,i);
            offset += s->sums[i].len - 1;
            k = MIN((len-offset), s->n);