~vcs-imports/rsync/master

« back to all changes in this revision

Viewing changes to token.c

  • Committer: Wayne Davison
  • Date: 2020-05-25 00:24:42 UTC
  • Revision ID: git-v1:64d5ea39c0bf4e0e15aeb1f4dae37fc5125fc0c7
More compress changes

- Add the zlibx (external-code compatible) compression name.
- Re-enable zlib support with the external library so it can be
  tried as a fallback if zlibx isn't available.
- Add --compress-choice=STR (aka -zz=STR) option.
- Make --cc=STR an alias for --checksum-choice=STR.
- Hook up the new compression negotiation logic.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
extern int def_compress_level;
30
30
extern char *skip_compress;
31
31
 
 
32
#ifndef Z_INSERT_ONLY
 
33
#define Z_INSERT_ONLY Z_SYNC_FLUSH
 
34
#endif
 
35
 
32
36
static int compression_level, per_file_default_level;
33
37
 
34
38
struct suffix_tree {
405
409
        } else if (token != -2 && do_compression == 1) {
406
410
                /* Add the data in the current block to the compressor's
407
411
                 * history and hash table. */
408
 
#ifndef EXTERNAL_ZLIB
409
412
                do {
410
413
                        /* Break up long sections in the same way that
411
414
                         * see_deflate_token() does. */
424
427
                                exit_cleanup(RERR_STREAMIO);
425
428
                        }
426
429
                } while (toklen > 0);
427
 
#else
428
 
                toklen++;
429
 
                rprintf(FERROR, "Impossible error in external-zlib code (1).\n");
430
 
                exit_cleanup(RERR_STREAMIO);
431
 
#endif
432
430
        }
433
431
}
434
432
 
579
577
 */
580
578
static void see_deflate_token(char *buf, int32 len)
581
579
{
582
 
#ifndef EXTERNAL_ZLIB
583
580
        int r;
584
581
        int32 blklen;
585
582
        unsigned char hdr[5];
617
614
                        exit_cleanup(RERR_STREAMIO);
618
615
                }
619
616
        } while (len || rx_strm.avail_out == 0);
620
 
#else
621
 
        buf++; len++;
622
 
        rprintf(FERROR, "Impossible error in external-zlib code (2).\n");
623
 
        exit_cleanup(RERR_STREAMIO);
624
 
#endif
625
617
}
626
618
 
627
619
/**