decompression errors always display the full origin filename
instead of the truncated size-limited version.
This commit is contained in:
+7
-14
@@ -1526,8 +1526,7 @@ FIO_compressZstdFrame(FIO_ctx_t* const fCtx,
|
|||||||
CHECK( ZSTD_CCtx_setPledgedSrcSize(ress.cctx, prefs->streamSrcSize) );
|
CHECK( ZSTD_CCtx_setPledgedSrcSize(ress.cctx, prefs->streamSrcSize) );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{ int windowLog;
|
||||||
int windowLog;
|
|
||||||
UTIL_HumanReadableSize_t windowSize;
|
UTIL_HumanReadableSize_t windowSize;
|
||||||
CHECK(ZSTD_CCtx_getParameter(ress.cctx, ZSTD_c_windowLog, &windowLog));
|
CHECK(ZSTD_CCtx_getParameter(ress.cctx, ZSTD_c_windowLog, &windowLog));
|
||||||
if (windowLog == 0) {
|
if (windowLog == 0) {
|
||||||
@@ -1542,7 +1541,6 @@ FIO_compressZstdFrame(FIO_ctx_t* const fCtx,
|
|||||||
windowSize = UTIL_makeHumanReadableSize(MAX(1ULL, MIN(1ULL << windowLog, pledgedSrcSize)));
|
windowSize = UTIL_makeHumanReadableSize(MAX(1ULL, MIN(1ULL << windowLog, pledgedSrcSize)));
|
||||||
DISPLAYLEVEL(4, "Decompression will require %.*f%s of memory\n", windowSize.precision, windowSize.value, windowSize.suffix);
|
DISPLAYLEVEL(4, "Decompression will require %.*f%s of memory\n", windowSize.precision, windowSize.value, windowSize.suffix);
|
||||||
}
|
}
|
||||||
(void)srcFileName;
|
|
||||||
|
|
||||||
/* Main compression loop */
|
/* Main compression loop */
|
||||||
do {
|
do {
|
||||||
@@ -2439,12 +2437,14 @@ FIO_decompressZstdFrame(FIO_ctx_t* const fCtx, dRess_t* ress,
|
|||||||
U64 alreadyDecoded) /* for multi-frames streams */
|
U64 alreadyDecoded) /* for multi-frames streams */
|
||||||
{
|
{
|
||||||
U64 frameSize = 0;
|
U64 frameSize = 0;
|
||||||
|
const char* srcFName20 = srcFileName;
|
||||||
IOJob_t* writeJob = AIO_WritePool_acquireJob(ress->writeCtx);
|
IOJob_t* writeJob = AIO_WritePool_acquireJob(ress->writeCtx);
|
||||||
|
assert(writeJob);
|
||||||
|
|
||||||
/* display last 20 characters only when not --verbose */
|
/* display last 20 characters only when not --verbose */
|
||||||
{ size_t const srcFileLength = strlen(srcFileName);
|
{ size_t const srcFileLength = strlen(srcFileName);
|
||||||
if ((srcFileLength>20) && (g_display_prefs.displayLevel<3))
|
if ((srcFileLength>20) && (g_display_prefs.displayLevel<3))
|
||||||
srcFileName += srcFileLength-20;
|
srcFName20 += srcFileLength-20;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSTD_DCtx_reset(ress->dctx, ZSTD_reset_session_only);
|
ZSTD_DCtx_reset(ress->dctx, ZSTD_reset_session_only);
|
||||||
@@ -2471,19 +2471,12 @@ FIO_decompressZstdFrame(FIO_ctx_t* const fCtx, dRess_t* ress,
|
|||||||
AIO_WritePool_enqueueAndReacquireWriteJob(&writeJob);
|
AIO_WritePool_enqueueAndReacquireWriteJob(&writeJob);
|
||||||
frameSize += outBuff.pos;
|
frameSize += outBuff.pos;
|
||||||
if (fCtx->nbFilesTotal > 1) {
|
if (fCtx->nbFilesTotal > 1) {
|
||||||
size_t srcFileNameSize = strlen(srcFileName);
|
|
||||||
if (srcFileNameSize > 18) {
|
|
||||||
const char* truncatedSrcFileName = srcFileName + srcFileNameSize - 15;
|
|
||||||
DISPLAYUPDATE_PROGRESS(
|
DISPLAYUPDATE_PROGRESS(
|
||||||
"\rDecompress: %2u/%2u files. Current: ...%s : %.*f%s... ",
|
"\rDecompress: %2u/%2u files. Current: %s : %.*f%s... ",
|
||||||
fCtx->currFileIdx+1, fCtx->nbFilesTotal, truncatedSrcFileName, hrs.precision, hrs.value, hrs.suffix);
|
fCtx->currFileIdx+1, fCtx->nbFilesTotal, srcFName20, hrs.precision, hrs.value, hrs.suffix);
|
||||||
} else {
|
|
||||||
DISPLAYUPDATE_PROGRESS("\rDecompress: %2u/%2u files. Current: %s : %.*f%s... ",
|
|
||||||
fCtx->currFileIdx+1, fCtx->nbFilesTotal, srcFileName, hrs.precision, hrs.value, hrs.suffix);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
DISPLAYUPDATE_PROGRESS("\r%-20.20s : %.*f%s... ",
|
DISPLAYUPDATE_PROGRESS("\r%-20.20s : %.*f%s... ",
|
||||||
srcFileName, hrs.precision, hrs.value, hrs.suffix);
|
srcFName20, hrs.precision, hrs.value, hrs.suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
AIO_ReadPool_consumeBytes(ress->readCtx, inBuff.pos);
|
AIO_ReadPool_consumeBytes(ress->readCtx, inBuff.pos);
|
||||||
|
|||||||
Reference in New Issue
Block a user