diff options
Diffstat (limited to 'xdelta3/xdelta3.c')
-rw-r--r-- | xdelta3/xdelta3.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c index 1ca1e32..515b083 100644 --- a/xdelta3/xdelta3.c +++ b/xdelta3/xdelta3.c | |||
@@ -2516,7 +2516,7 @@ xd3_getblk (xd3_stream *stream, xoff_t blkno) | |||
2516 | } | 2516 | } |
2517 | 2517 | ||
2518 | ret = stream->getblk (stream, source, blkno); | 2518 | ret = stream->getblk (stream, source, blkno); |
2519 | 2519 | IF_DEBUG1 (DP(RINT "[getblk] func ret %d\n", ret)); | |
2520 | if (ret != 0) | 2520 | if (ret != 0) |
2521 | { | 2521 | { |
2522 | stream->msg = "getblk failed"; | 2522 | stream->msg = "getblk failed"; |
@@ -2579,9 +2579,6 @@ xd3_set_source (xd3_stream *stream, | |||
2579 | { | 2579 | { |
2580 | usize_t shiftby; | 2580 | usize_t shiftby; |
2581 | 2581 | ||
2582 | IF_DEBUG2 (DP(RINT "[set source] %s\n", | ||
2583 | stream->getblk == NULL ? "async" : "sync")); | ||
2584 | |||
2585 | stream->src = src; | 2582 | stream->src = src; |
2586 | src->srclen = 0; | 2583 | src->srclen = 0; |
2587 | src->srcbase = 0; | 2584 | src->srcbase = 0; |
@@ -3776,6 +3773,8 @@ xd3_encode_input (xd3_stream *stream) | |||
3776 | return XD3_WINSTART; | 3773 | return XD3_WINSTART; |
3777 | 3774 | ||
3778 | case ENC_SEARCH: | 3775 | case ENC_SEARCH: |
3776 | IF_DEBUG1 (DP(RINT "[SEARCH] match_state %d avail_in %u %s\n", | ||
3777 | stream->match_state, stream->avail_in, stream->src ? "source" : "no source")); | ||
3779 | 3778 | ||
3780 | /* Reentrant matching. */ | 3779 | /* Reentrant matching. */ |
3781 | if (stream->src != NULL) | 3780 | if (stream->src != NULL) |
@@ -3793,7 +3792,7 @@ xd3_encode_input (xd3_stream *stream) | |||
3793 | if (stream->avail_in > 0) | 3792 | if (stream->avail_in > 0) |
3794 | { | 3793 | { |
3795 | /* This call can't fail because the source window is | 3794 | /* This call can't fail because the source window is |
3796 | unrestricted. */ | 3795 | * unrestricted. */ |
3797 | ret = xd3_source_match_setup (stream, stream->match_srcpos); | 3796 | ret = xd3_source_match_setup (stream, stream->match_srcpos); |
3798 | XD3_ASSERT (ret == 0); | 3797 | XD3_ASSERT (ret == 0); |
3799 | stream->match_state = MATCH_FORWARD; | 3798 | stream->match_state = MATCH_FORWARD; |
@@ -4336,6 +4335,7 @@ xd3_source_match_setup (xd3_stream *stream, xoff_t srcpos) | |||
4336 | * TestNonBlockingProgress test! */ | 4335 | * TestNonBlockingProgress test! */ |
4337 | if (srcpos != 0 && srcpos == stream->match_last_srcpos) | 4336 | if (srcpos != 0 && srcpos == stream->match_last_srcpos) |
4338 | { | 4337 | { |
4338 | IF_DEBUG1(DP(RINT "[match_setup] looping failure\n")); | ||
4339 | goto bad; | 4339 | goto bad; |
4340 | } | 4340 | } |
4341 | 4341 | ||
@@ -4402,6 +4402,7 @@ xd3_source_match_setup (xd3_stream *stream, xoff_t srcpos) | |||
4402 | /* Restricted case: fail if the srcpos lies outside the source window */ | 4402 | /* Restricted case: fail if the srcpos lies outside the source window */ |
4403 | if ((srcpos < src->srcbase) || (srcpos > (src->srcbase + (xoff_t) src->srclen))) | 4403 | if ((srcpos < src->srcbase) || (srcpos > (src->srcbase + (xoff_t) src->srclen))) |
4404 | { | 4404 | { |
4405 | IF_DEBUG1(DP(RINT "[match_setup] restricted source window failure\n")); | ||
4405 | goto bad; | 4406 | goto bad; |
4406 | } | 4407 | } |
4407 | else | 4408 | else |
@@ -4513,6 +4514,9 @@ xd3_source_extend_match (xd3_stream *stream) | |||
4513 | usize_t tryrem; /* tryrem is the number of matchable bytes */ | 4514 | usize_t tryrem; /* tryrem is the number of matchable bytes */ |
4514 | usize_t matched; | 4515 | usize_t matched; |
4515 | 4516 | ||
4517 | IF_DEBUG1(DP(RINT "[extend match] srcpos %"Q"u\n", | ||
4518 | stream->match_srcpos)); | ||
4519 | |||
4516 | XD3_ASSERT (src != NULL); | 4520 | XD3_ASSERT (src != NULL); |
4517 | 4521 | ||
4518 | /* Does it make sense to compute backward match AFTER forward match? */ | 4522 | /* Does it make sense to compute backward match AFTER forward match? */ |
@@ -5302,7 +5306,7 @@ XD3_TEMPLATE(xd3_string_match_) (xd3_stream *stream) | |||
5302 | /* Maybe output a COPY instruction */ | 5306 | /* Maybe output a COPY instruction */ |
5303 | if (match_length >= stream->min_match) | 5307 | if (match_length >= stream->min_match) |
5304 | { | 5308 | { |
5305 | IF_DEBUG1 ({ | 5309 | IF_DEBUG2 ({ |
5306 | static int x = 0; | 5310 | static int x = 0; |
5307 | DP(RINT "[target match:%d] <inp %u %u> <cpy %u %u> " | 5311 | DP(RINT "[target match:%d] <inp %u %u> <cpy %u %u> " |
5308 | "(-%d) [ %u bytes ]\n", | 5312 | "(-%d) [ %u bytes ]\n", |