MCPcopy Create free account
hub / github.com/apache/trafficserver / brotli_transform_finish

Function brotli_transform_finish

plugins/compress/compress.cc:551–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549
550#if HAVE_BROTLI_ENCODE_H
551static void
552brotli_transform_finish(Data *data)
553{
554 if (data->state != transform_state_output) {
555 return;
556 }
557
558 data->state = transform_state_finished;
559
560 bool ok = brotli_compress_operation(data, nullptr, 0, BROTLI_OPERATION_FINISH);
561 if (!ok) {
562 error("BrotliEncoderCompressStream(PROCESS) call failed");
563 return;
564 }
565
566 if (data->downstream_length != static_cast<int64_t>(data->bstrm.total_out)) {
567 error("brotli-transform: output lengths don't match (%d, %ld)", data->downstream_length, data->bstrm.total_out);
568 }
569
570 debug("brotli-transform: Finished brotli");
571 log_compression_ratio(data->bstrm.total_in, data->downstream_length);
572}
573#endif
574
575static void

Callers 1

Calls 3

errorFunction · 0.85
log_compression_ratioFunction · 0.85

Tested by

no test coverage detected