# HG changeset patch # User Alain Mazy # Date 1659945547 -7200 # Node ID 5c997c72603c713fef9cc5bb64bdb4b90f48dc5c # Parent d4e5ca0c93070f51c54a52cd4dea743e16fa3a39 Fix the Storage Cache for compressed files (bug introduced in 1.11.0) diff -r d4e5ca0c9307 -r 5c997c72603c NEWS --- a/NEWS Wed Aug 03 10:49:50 2022 +0200 +++ b/NEWS Mon Aug 08 09:59:07 2022 +0200 @@ -11,6 +11,7 @@ * Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0). +* Fix the Storage Cache for compressed files (bug introduced in 1.11.0). Maintenance @@ -20,6 +21,7 @@ * SQLite now closes and deletes WAL and SHM files on exit. This should improve handling of SQLite DB over network drives. + Version 1.11.1 (2022-06-30) =========================== diff -r d4e5ca0c9307 -r 5c997c72603c OrthancFramework/Sources/FileStorage/StorageAccessor.cpp --- 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 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