]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote-tracking branch 'ahf/bugs/22286' into maint-0.3.1
authorNick Mathewson <nickm@torproject.org>
Tue, 8 Aug 2017 14:03:08 +0000 (10:03 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 8 Aug 2017 14:03:08 +0000 (10:03 -0400)
1  2 
src/common/compress_zstd.c
src/test/test_util.c

index 94974dec0609ab649b16fd77168dab128e60551f,f54c4e1b3182adb69080237d78888ac89ea98413..5c5026c37d78d325c370afc7e8f2aa535fe48b6a
@@@ -307,9 -309,10 +318,10 @@@ tor_zstd_compress_process(tor_zstd_comp
               state->compress ? "compression" : "decompression",
               ZSTD_getErrorName(retval));
      return TOR_COMPRESS_ERROR;
+     // LCOV_EXCL_STOP
    }
  
 -  if (state->compress && !finish) {
 +  if (state->compress && !state->have_called_end) {
      retval = ZSTD_flushStream(state->u.compress_stream, &output);
  
      *out = (char *)output.dst + output.pos;
        log_warn(LD_GENERAL, "Zstandard compression unable to flush: %s.",
                 ZSTD_getErrorName(retval));
        return TOR_COMPRESS_ERROR;
+       // LCOV_EXCL_STOP
      }
  
 -    if (retval > 0)
 +    // ZSTD_flushStream returns 0 if the frame is done, or >0 if it
 +    // is incomplete.
 +    if (retval > 0) {
        return TOR_COMPRESS_BUFFER_FULL;
 +    }
    }
  
    if (!finish) {
Simple merge