Skip to content

Commit 9deac34

Browse files
committed
restore: fix Zstandard frame handling
The snapdc tile is not conformant to the Zstandard spec. Namely, Zstandard compressors are supposed to accept arbitrary concatenation of frames and ignore skippable frames. Fixes a bug where the snapshot loader aborted after the first Zstandard frame.
1 parent fa46220 commit 9deac34

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/discof/restore/fd_snapdc_tile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ handle_data_frag( fd_snapdc_tile_t * ctx,
176176
uchar * out = fd_chunk_to_laddr( ctx->out.wksp, ctx->out.chunk );
177177

178178
if( FD_UNLIKELY( !ctx->is_zstd ) ) {
179+
uchar const * in = data+ctx->in.frag_pos;
180+
179181
FD_TEST( ctx->in.frag_pos<sz );
180182
ulong cpy = fd_ulong_min( sz-ctx->in.frag_pos, ctx->out.mtu );
181183
fd_memcpy( out, in, cpy );

0 commit comments

Comments
 (0)