aboutsummaryrefslogtreecommitdiff
path: root/src/common/compress_zstd.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-08-08 10:08:06 -0400
committerNick Mathewson <nickm@torproject.org>2017-08-08 10:08:06 -0400
commit7465ea4ad906d2c1fb8a31c01c29b62ccfe7a590 (patch)
tree72da2fd2288fab3194b39de998042392d2f3f49b /src/common/compress_zstd.c
parent6121ca16bc83cf74f0c4bc3f71b3150cd18aa43c (diff)
downloadtor-7465ea4ad906d2c1fb8a31c01c29b62ccfe7a590.tar.gz
tor-7465ea4ad906d2c1fb8a31c01c29b62ccfe7a590.zip
Remove some LCOV_EXCL stuff that I think may be testable after all.
This is partial revert on 22286. Also, tweak some log messages to be distinct.
Diffstat (limited to 'src/common/compress_zstd.c')
-rw-r--r--src/common/compress_zstd.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/common/compress_zstd.c b/src/common/compress_zstd.c
index 5c5026c37d..0808bcd9ab 100644
--- a/src/common/compress_zstd.c
+++ b/src/common/compress_zstd.c
@@ -197,7 +197,8 @@ tor_zstd_compress_new(int compress,
if (result->u.compress_stream == NULL) {
// LCOV_EXCL_START
- log_warn(LD_GENERAL, "Error while creating Zstandard stream");
+ log_warn(LD_GENERAL, "Error while creating Zstandard compression "
+ "stream");
goto err;
// LCOV_EXCL_STOP
}
@@ -216,7 +217,8 @@ tor_zstd_compress_new(int compress,
if (result->u.decompress_stream == NULL) {
// LCOV_EXCL_START
- log_warn(LD_GENERAL, "Error while creating Zstandard stream");
+ log_warn(LD_GENERAL, "Error while creating Zstandard decompression "
+ "stream");
goto err;
// LCOV_EXCL_STOP
}
@@ -313,12 +315,10 @@ tor_zstd_compress_process(tor_zstd_compress_state_t *state,
}
if (ZSTD_isError(retval)) {
- // LCOV_EXCL_START
log_warn(LD_GENERAL, "Zstandard %s didn't finish: %s.",
state->compress ? "compression" : "decompression",
ZSTD_getErrorName(retval));
return TOR_COMPRESS_ERROR;
- // LCOV_EXCL_STOP
}
if (state->compress && !state->have_called_end) {
@@ -328,11 +328,9 @@ tor_zstd_compress_process(tor_zstd_compress_state_t *state,
*out_len = output.size - output.pos;
if (ZSTD_isError(retval)) {
- // LCOV_EXCL_START
log_warn(LD_GENERAL, "Zstandard compression unable to flush: %s.",
ZSTD_getErrorName(retval));
return TOR_COMPRESS_ERROR;
- // LCOV_EXCL_STOP
}
// ZSTD_flushStream returns 0 if the frame is done, or >0 if it
@@ -359,12 +357,10 @@ tor_zstd_compress_process(tor_zstd_compress_state_t *state,
*out_len = output.size - output.pos;
if (ZSTD_isError(retval)) {
- // LCOV_EXCL_START
log_warn(LD_GENERAL, "Zstandard compression unable to write "
"epilogue: %s.",
ZSTD_getErrorName(retval));
return TOR_COMPRESS_ERROR;
- // LCOV_EXCL_STOP
}
// endStream returns the number of bytes that is needed to write the