changeset 6997:936dd64d8f7b streaming

cleanup TODO-streaming: checkMD5 + StorageCacheSize
author Alain Mazy <am@orthanc.team>
date Mon, 06 Jul 2026 10:55:46 +0200
parents 64a0500e449f
children 2452b20f75a8
files OrthancServer/Sources/ServerContext.cpp OrthancServer/Sources/ServerContext.h OrthancServer/Sources/main.cpp
diffstat 3 files changed, 11 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerContext.cpp	Mon Jul 06 10:31:20 2026 +0200
+++ b/OrthancServer/Sources/ServerContext.cpp	Mon Jul 06 10:55:46 2026 +0200
@@ -550,8 +550,6 @@
   {
     try
     {
-      bool checkMD5 = true;
-
       {
         OrthancConfiguration::ReaderLock lock;
 
@@ -677,8 +675,6 @@
         SetAcceptedSopClasses(acceptedSopClasses, rejectedSopClasses);
 
         defaultDicomRetrieveMethod_ = StringToRetrieveMethod(lock.GetConfiguration().GetDicomDefaultRetrieveMethod());
-
-        checkMD5 = lock.GetConfiguration().GetBooleanParameter("CheckMD5", true);  // TODO-Streaming - Parameter
       }
 
       jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200);
@@ -755,7 +751,7 @@
         pool->SetMetricsConfiguration(*metricsRegistry_, METRICS_STORAGE_THREAD_POOL_AVAILABLE_THREADS);
         pool->Start();
 
-        std::unique_ptr<StorageAreaDataSource> source(new StorageAreaDataSource(area_, checkMD5));
+        std::unique_ptr<StorageAreaDataSource> source(new StorageAreaDataSource(area_, IsStoreMD5ForAttachments()));
         source->SetMetricsRegistry(metricsRegistry_,
                                    METRICS_STORAGE_AREA_READ_BYTES, METRICS_STORAGE_AREA_READ_DURATION);
 
@@ -773,6 +769,15 @@
 
         storageAreaReader_->SetCapacity(storageMemoryCapacityMb * MEGABYTE);
         storageAreaReader_->CreateCache(storageCacheSizeMb * MEGABYTE);
+        
+        if (storageCacheSizeMb == 0)
+        {
+          LOG(WARNING) << "Storage cache is disabled";
+        }
+        else
+        {
+          LOG(WARNING) << "Storage cache size is " << storageCacheSizeMb << " MB";
+        }
       }
 
       {
--- a/OrthancServer/Sources/ServerContext.h	Mon Jul 06 10:31:20 2026 +0200
+++ b/OrthancServer/Sources/ServerContext.h	Mon Jul 06 10:55:46 2026 +0200
@@ -322,11 +322,6 @@
       return index_;
     }
 
-    void SetMaximumStorageCacheSize(size_t size)
-    {
-      // TODO-Streaming
-    }
-
     void SetPatientLevelEnabled(bool enabled);
 
     bool IsPatientLevelEnabled() const
@@ -369,7 +364,7 @@
 
     StoreResult TranscodeAndStore(std::string& resultPublicId,
                                   DicomInstanceToStore* dicom,
-                                  bool isReconstruct = false);  // TODO-Streaming: To check
+                                  bool isReconstruct = false);
 
     void AnswerAttachment(RestApiOutput& output,
                           const FileInfo& fileInfo,
--- a/OrthancServer/Sources/main.cpp	Mon Jul 06 10:31:20 2026 +0200
+++ b/OrthancServer/Sources/main.cpp	Mon Jul 06 10:55:46 2026 +0200
@@ -1789,26 +1789,6 @@
         context.GetIndex().SetMaximumStorageMode(MaxStorageMode_Recycle);
       }
     }
-
-    // note: this config is valid in ReadOnlyMode
-    try
-    {
-      uint64_t size = lock.GetConfiguration().GetMaximumStorageCacheSize();
-      if (size == 0)
-      {
-        LOG(WARNING) << "Storage cache is disabled";
-      }
-      else
-      {
-        LOG(WARNING) << "Storage cache size is " << size << " MB";
-      }
-      
-      context.SetMaximumStorageCacheSize(size * 1024 * 1024);
-    }
-    catch (...)
-    {
-      context.SetMaximumStorageCacheSize(128);
-    }
   }
 
   {