Mercurial > hg > orthanc
diff OrthancFramework/Sources/FileStorage/StorageAccessor.cpp @ 5059:5c997c72603c
Fix the Storage Cache for compressed files (bug introduced in 1.11.0)
author | Alain Mazy <am@osimis.io> |
---|---|
date | Mon, 08 Aug 2022 09:59:07 +0200 |
parents | 22966345eaba |
children | d7274e43ea7c dd085f7e7e71 |
line wrap: on
line diff
--- a/OrthancFramework/Sources/FileStorage/StorageAccessor.cpp Wed Aug 03 10:49:50 2022 +0200 +++ b/OrthancFramework/Sources/FileStorage/StorageAccessor.cpp Mon Aug 08 09:59:07 2022 +0200 @@ -269,17 +269,7 @@ const FileInfo& info, const std::string& mime) { - if (cache_ == NULL || !cache_->Fetch(sender.GetBuffer(), info.GetUuid(), info.GetContentType())) - { - MetricsTimer timer(*this, METRICS_READ); - std::unique_ptr<IMemoryBuffer> buffer(area_.Read(info.GetUuid(), info.GetContentType())); - buffer->MoveToString(sender.GetBuffer()); - - if (cache_ != NULL) - { - cache_->Add(info.GetUuid(), info.GetContentType(), sender.GetBuffer()); - } - } + Read(sender.GetBuffer(), info); sender.SetContentType(mime); @@ -323,7 +313,7 @@ BufferHttpSender sender; SetupSender(sender, info, mime); - HttpStreamTranscoder transcoder(sender, info.GetCompressionType()); + HttpStreamTranscoder transcoder(sender, CompressionType_None); // since 1.11.2, the storage accessor only returns uncompressed buffers output.Answer(transcoder); } #endif @@ -347,7 +337,7 @@ BufferHttpSender sender; SetupSender(sender, info, mime); - HttpStreamTranscoder transcoder(sender, info.GetCompressionType()); + HttpStreamTranscoder transcoder(sender, CompressionType_None); // since 1.11.2, the storage accessor only returns uncompressed buffers output.AnswerStream(transcoder); } #endif