changeset 5993:9c20ede25ef8

In the ExtendedFind mode, optimized tools/find when StorageAccessMode is set to Never
author Alain Mazy <am@orthanc.team>
date Thu, 30 Jan 2025 09:02:01 +0100
parents 773a082325f4
children bad103ab55c5 6ee625ebd09c
files NEWS OrthancServer/Plugins/Engine/OrthancPlugins.cpp OrthancServer/Sources/ResourceFinder.cpp
diffstat 3 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed Jan 22 15:20:38 2025 +0100
+++ b/NEWS	Thu Jan 30 09:02:01 2025 +0100
@@ -1,6 +1,12 @@
 Pending changes in the mainline
 ===============================
 
+Maintenance
+-----------
+
+* In the "ExtendedFind" mode, optimized "tools/find" when "StorageAccessMode" is 
+  set to "Never".
+
 
 Version 1.12.6 (2025-01-22)
 ===========================
--- a/OrthancServer/Plugins/Engine/OrthancPlugins.cpp	Wed Jan 22 15:20:38 2025 +0100
+++ b/OrthancServer/Plugins/Engine/OrthancPlugins.cpp	Thu Jan 30 09:02:01 2025 +0100
@@ -4684,7 +4684,7 @@
 
     if (entry == NULL)
     {
-      throw OrthancException(ErrorCode_UnknownDicomTag);
+      throw OrthancException(ErrorCode_UnknownDicomTag, p.name);
     }
     else
     {
--- a/OrthancServer/Sources/ResourceFinder.cpp	Wed Jan 22 15:20:38 2025 +0100
+++ b/OrthancServer/Sources/ResourceFinder.cpp	Thu Jan 30 09:02:01 2025 +0100
@@ -849,7 +849,8 @@
 
       if (request_.GetLevel() != ResourceType_Instance)
       {
-        request_.SetRetrieveOneInstanceMetadataAndAttachments(true);
+        // only retrieve the instance attachments and metadata if we have allowed access to the storage
+        request_.SetRetrieveOneInstanceMetadataAndAttachments(IsStorageAccessAllowed());
       }
     }
   }