fprintf(FERROR,"match at %d last_match=%d j=%d len=%d n=%d\n",
(int)offset,(int)last_match,i,(int)s->sums[i].len,n);
- if (n > 0) {
- int l = 0;
- write_int(f,n);
- while (l < n) {
- int n1 = MIN(CHUNK_SIZE,n-l);
- write_buf(f,map_ptr(buf,last_match+l,n1),n1);
- l += n1;
- }
- data_transfer += n;
- }
- write_int(f,-(i+1));
+ send_token(f,i,buf,last_match,n);
+
+ data_transfer += n;
+
+ if (i != -1)
+ last_match = offset + s->sums[i].len;
+
if (i != -1)
last_match = offset + s->sums[i].len;
if (n > 0)