diff options
-rwxr-xr-x | xdelta3/Makefile | 8 | ||||
-rwxr-xr-x | xdelta3/xdelta3.c | 13 | ||||
-rwxr-xr-x | xdelta3/xdelta3.h | 2 |
3 files changed, 16 insertions, 7 deletions
diff --git a/xdelta3/Makefile b/xdelta3/Makefile index d6a6b5b..ef5468d 100755 --- a/xdelta3/Makefile +++ b/xdelta3/Makefile | |||
@@ -13,7 +13,7 @@ SOURCES = xdelta3-cfgs.h \ | |||
13 | xdelta3.c \ | 13 | xdelta3.c \ |
14 | xdelta3.h | 14 | xdelta3.h |
15 | 15 | ||
16 | TARGETS = xdelta3 xdelta3-1 xdelta3-2 xdelta3-64 xdelta3-everything \ | 16 | TARGETS = xdelta3 xdelta3-1 xdelta3-debug xdelta3-64 xdelta3-everything \ |
17 | xdelta3-Opg xdelta3-64-O xdelta3-Op xdelta3-O \ | 17 | xdelta3-Opg xdelta3-64-O xdelta3-Op xdelta3-O \ |
18 | xdelta3-decoder xdelta3-decoder-nomain.o \ | 18 | xdelta3-decoder xdelta3-decoder-nomain.o \ |
19 | $(PYTGT) \ | 19 | $(PYTGT) \ |
@@ -32,7 +32,7 @@ EXTRA = Makefile COPYING linkxd3lib.c badcopy.c www | |||
32 | REL=0h_pre0 | 32 | REL=0h_pre0 |
33 | RELDIR = xdelta3$(REL) | 33 | RELDIR = xdelta3$(REL) |
34 | 34 | ||
35 | all: xdelta3 $(PYTGT) | 35 | all: xdelta3 xdelta3-debug $(PYTGT) |
36 | 36 | ||
37 | all-targets: $(TARGETS) | 37 | all-targets: $(TARGETS) |
38 | 38 | ||
@@ -65,8 +65,8 @@ xdelta3-1: $(SOURCES) | |||
65 | $(CC) -g -Wall -Wshadow xdelta3.c -o xdelta3-1 -DXD3_MAIN=1 -DGENERIC_ENCODE_TABLES=1 \ | 65 | $(CC) -g -Wall -Wshadow xdelta3.c -o xdelta3-1 -DXD3_MAIN=1 -DGENERIC_ENCODE_TABLES=1 \ |
66 | -DXD3_USE_LARGEFILE64=1 -DREGRESSION_TEST=1 -DXD3_DEBUG=1 -DSECONDARY_DJW=1 -lm | 66 | -DXD3_USE_LARGEFILE64=1 -DREGRESSION_TEST=1 -DXD3_DEBUG=1 -DSECONDARY_DJW=1 -lm |
67 | 67 | ||
68 | xdelta3-2: $(SOURCES) | 68 | xdelta3-debug: $(SOURCES) |
69 | $(CC) -g -Wall -Wshadow xdelta3.c -o xdelta3-2 -DXD3_MAIN=1 -DGENERIC_ENCODE_TABLES=1 \ | 69 | $(CC) -g -Wall -Wshadow xdelta3.c -o xdelta3-debug -DXD3_MAIN=1 -DGENERIC_ENCODE_TABLES=1 \ |
70 | -DXD3_USE_LARGEFILE64=1 -DREGRESSION_TEST=1 -DXD3_DEBUG=2 -DSECONDARY_DJW=1 -lm | 70 | -DXD3_USE_LARGEFILE64=1 -DREGRESSION_TEST=1 -DXD3_DEBUG=2 -DSECONDARY_DJW=1 -lm |
71 | 71 | ||
72 | xdelta3-decoder: $(SOURCES) | 72 | xdelta3-decoder: $(SOURCES) |
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c index 7e68c57..e2f4f28 100755 --- a/xdelta3/xdelta3.c +++ b/xdelta3/xdelta3.c | |||
@@ -3982,9 +3982,9 @@ xd3_srcwin_move_point (xd3_stream *stream, usize_t *next_move_point) | |||
3982 | 3982 | ||
3983 | /* If the stream has matched beyond the srcwin_cksum_pos (good), we shouldn't | 3983 | /* If the stream has matched beyond the srcwin_cksum_pos (good), we shouldn't |
3984 | * begin reading so far back. */ | 3984 | * begin reading so far back. */ |
3985 | if (stream->match_maxaddr > stream->srcwin_cksum_pos) | 3985 | if (stream->maxsrcaddr > stream->srcwin_cksum_pos) |
3986 | { | 3986 | { |
3987 | stream->srcwin_cksum_pos = stream->match_maxaddr; | 3987 | stream->srcwin_cksum_pos = stream->maxsrcaddr; |
3988 | } | 3988 | } |
3989 | 3989 | ||
3990 | if (logical_input_cksum_pos < stream->srcwin_cksum_pos) | 3990 | if (logical_input_cksum_pos < stream->srcwin_cksum_pos) |
@@ -4019,7 +4019,7 @@ xd3_srcwin_move_point (xd3_stream *stream, usize_t *next_move_point) | |||
4019 | { | 4019 | { |
4020 | if (ret == XD3_TOOFARBACK) | 4020 | if (ret == XD3_TOOFARBACK) |
4021 | { | 4021 | { |
4022 | // TODO: this is still happening | 4022 | // TODO: this may still be happening, or fixed by stream->srcmaxaddr? |
4023 | ret = XD3_INTERNAL; | 4023 | ret = XD3_INTERNAL; |
4024 | } | 4024 | } |
4025 | return ret; | 4025 | return ret; |
@@ -4399,9 +4399,16 @@ xd3_source_extend_match (xd3_stream *stream) | |||
4399 | 4399 | ||
4400 | if (match_end > stream->match_maxaddr) | 4400 | if (match_end > stream->match_maxaddr) |
4401 | { | 4401 | { |
4402 | // Note: per-window | ||
4402 | stream->match_maxaddr = match_end; | 4403 | stream->match_maxaddr = match_end; |
4403 | } | 4404 | } |
4404 | 4405 | ||
4406 | if (match_end > stream->maxsrcaddr) | ||
4407 | { | ||
4408 | // Note: across windows | ||
4409 | stream->maxsrcaddr = match_end; | ||
4410 | } | ||
4411 | |||
4405 | IF_DEBUG1 ({ | 4412 | IF_DEBUG1 ({ |
4406 | static int x = 0; | 4413 | static int x = 0; |
4407 | P(RINT "[source match:%d] <inp %"Q"u %"Q"u> <src %"Q"u %"Q"u> (%s) [ %u bytes ]\n", | 4414 | P(RINT "[source match:%d] <inp %"Q"u %"Q"u> <src %"Q"u %"Q"u> (%s) [ %u bytes ]\n", |
diff --git a/xdelta3/xdelta3.h b/xdelta3/xdelta3.h index 0f11854..71fe681 100755 --- a/xdelta3/xdelta3.h +++ b/xdelta3/xdelta3.h | |||
@@ -689,6 +689,8 @@ struct _xd3_stream | |||
689 | usize_t match_fwd; /* match extends forward so far */ | 689 | usize_t match_fwd; /* match extends forward so far */ |
690 | usize_t match_maxfwd; /* match extends forward maximum */ | 690 | usize_t match_maxfwd; /* match extends forward maximum */ |
691 | 691 | ||
692 | xoff_t maxsrcaddr; /* address of the last source match (across windows) */ | ||
693 | |||
692 | uint8_t *buf_in; /* for saving buffered input */ | 694 | uint8_t *buf_in; /* for saving buffered input */ |
693 | usize_t buf_avail; /* amount of saved input */ | 695 | usize_t buf_avail; /* amount of saved input */ |
694 | const uint8_t *buf_leftover; /* leftover content of next_in (i.e., user's buffer) */ | 696 | const uint8_t *buf_leftover; /* leftover content of next_in (i.e., user's buffer) */ |