changeset 5277:acaea72a3e91 Orthanc-1.12.0

Orthanc-1.12.0
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Apr 2023 17:31:27 +0200
parents d00064ec4baf
children ed7257b61bd7 ca6df6e6c7a6
files CITATION.cff NEWS OrthancFramework/Resources/CMake/OrthancFrameworkParameters.cmake OrthancFramework/SharedLibrary/DllMain.cpp OrthancServer/Plugins/Samples/MultitenantDicom/Plugin.cpp OrthancServer/Resources/RunCppCheck.sh OrthancServer/Sources/Database/StatelessDatabaseOperations.h OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.cpp OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.h OrthancServer/Sources/ServerToolbox.cpp
diffstat 10 files changed, 68 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/CITATION.cff	Fri Apr 14 13:20:24 2023 +0200
+++ b/CITATION.cff	Fri Apr 14 17:31:27 2023 +0200
@@ -10,5 +10,5 @@
 doi: "10.1007/s10278-018-0082-y"
 license: "GPL-3.0-or-later"
 repository-code: "https://hg.orthanc-server.com/orthanc/"
-version: 1.10.1
-date-released: 2022-03-23
+version: 1.12.0
+date-released: 2023-04-14
--- a/NEWS	Fri Apr 14 13:20:24 2023 +0200
+++ b/NEWS	Fri Apr 14 17:31:27 2023 +0200
@@ -1,6 +1,10 @@
 Pending changes in the mainline
 ===============================
 
+
+Version 1.12.0 (2023-04-14)
+===========================
+
 General
 -------
 
--- a/OrthancFramework/Resources/CMake/OrthancFrameworkParameters.cmake	Fri Apr 14 13:20:24 2023 +0200
+++ b/OrthancFramework/Resources/CMake/OrthancFrameworkParameters.cmake	Fri Apr 14 17:31:27 2023 +0200
@@ -24,7 +24,7 @@
 #####################################################################
 
 # Version of the build, should always be "mainline" except in release branches
-set(ORTHANC_VERSION "mainline")
+set(ORTHANC_VERSION "1.12.0")
 
 # Version of the database schema. History:
 #   * Orthanc 0.1.0 -> Orthanc 0.3.0 = no versioning
--- a/OrthancFramework/SharedLibrary/DllMain.cpp	Fri Apr 14 13:20:24 2023 +0200
+++ b/OrthancFramework/SharedLibrary/DllMain.cpp	Fri Apr 14 17:31:27 2023 +0200
@@ -27,35 +27,55 @@
    ${BOOST_SOURCES_DIR}/libs/thread/src/win32/tss_dll.cpp
    ${OPENSSL_SOURCES_DIR}/crypto/dllmain.c
 
- **/
+**/
 
 #if defined(_WIN32) || defined(__CYGWIN__)
-# ifdef __CYGWIN__
-#  include <windows.h>
-# endif
+
+#include <boost/thread/detail/tss_hooks.hpp>
+
+#include <windows.h>
+
+#include <crypto/cryptlib.h>
 
-#include "e_os.h"
-#include "crypto/cryptlib.h"
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+#if defined(__BORLANDC__)
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE /*hInstance*/, DWORD dwReason, LPVOID /*lpReserved*/)
+#elif defined(_WIN32_WCE)
+  extern "C" BOOL WINAPI DllMain(HANDLE /*hInstance*/, DWORD dwReason, LPVOID /*lpReserved*/)
+#else
+  extern "C" BOOL WINAPI DllMain(HINSTANCE /*hInstance*/, DWORD dwReason, LPVOID /*lpReserved*/)
+#endif
 {
-  switch (fdwReason)
+  switch(dwReason)
   {
     case DLL_PROCESS_ATTACH:
+    {
       //OPENSSL_cpuid_setup();  // TODO - Is this necessary?
+      boost::on_process_enter();
+      boost::on_thread_enter();
       break;
-        
+    }
+
     case DLL_THREAD_ATTACH:
+    {
+      boost::on_thread_enter();
       break;
-        
+    }
+
     case DLL_THREAD_DETACH:
+    {
       OPENSSL_thread_stop();
+      boost::on_thread_exit();
       break;
-        
+    }
+
     case DLL_PROCESS_DETACH:
+    {
+      boost::on_thread_exit();
+      boost::on_process_exit();
       break;
+    }
   }
-    
+
   return TRUE;
 }
 
--- a/OrthancServer/Plugins/Samples/MultitenantDicom/Plugin.cpp	Fri Apr 14 13:20:24 2023 +0200
+++ b/OrthancServer/Plugins/Samples/MultitenantDicom/Plugin.cpp	Fri Apr 14 17:31:27 2023 +0200
@@ -120,10 +120,9 @@
       return -1;
     }
 
-    Orthanc::FromDcmtkBridge::InitializeDictionary(false /* loadPrivateDictionary */);
     /* Disable "gethostbyaddr" (which results in memory leaks) and use raw IP addresses */
     dcmDisableGethostbyaddr.set(OFTrue);
-    
+
     OrthancPluginSetDescription(context, "Multitenant plugin for Orthanc.");
 
     OrthancPluginRegisterOnChangeCallback(context, OnChangeCallback);
--- a/OrthancServer/Resources/RunCppCheck.sh	Fri Apr 14 13:20:24 2023 +0200
+++ b/OrthancServer/Resources/RunCppCheck.sh	Fri Apr 14 17:31:27 2023 +0200
@@ -13,10 +13,10 @@
 knownArgument:../../OrthancFramework/UnitTestsSources/ImageTests.cpp
 knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp
 nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:322
-stlFindInsert:../../OrthancFramework/Sources/DicomFormat/DicomMap.cpp:1403
+stlFindInsert:../../OrthancFramework/Sources/DicomFormat/DicomMap.cpp:1475
 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:165
 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:73
-stlFindInsert:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:372
+stlFindInsert:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:373
 stlFindInsert:../../OrthancServer/Sources/OrthancWebDav.cpp:377
 stlFindInsert:../../OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp:40
 stlFindInsert:../../OrthancServer/Sources/ServerJobs/SplitStudyJob.cpp:190
@@ -33,10 +33,10 @@
 useInitializationList:../../OrthancFramework/Sources/Images/PngWriter.cpp:98
 useInitializationList:../../OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp:274
 assertWithSideEffect:../../OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp:276
-assertWithSideEffect:../../OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp:1018
+assertWithSideEffect:../../OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp:1025
 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:289
 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:388
-assertWithSideEffect:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:3490
+assertWithSideEffect:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:3526
 assertWithSideEffect:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:272
 EOF
 
--- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.h	Fri Apr 14 13:20:24 2023 +0200
+++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.h	Fri Apr 14 17:31:27 2023 +0200
@@ -70,6 +70,16 @@
     std::set<std::string>               labels_;
 
   public:
+    // TODO - Cleanup
+    ExpandedResource() :
+      level_(ResourceType_Instance),
+      isStable_(false),
+      expectedNumberOfInstances_(0),
+      fileSize_(0),
+      indexInSeries_(0)
+    {
+    }
+    
     void SetResource(ResourceType level,
                      const std::string& id)
     {
--- a/OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.cpp	Fri Apr 14 13:20:24 2023 +0200
+++ b/OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.cpp	Fri Apr 14 17:31:27 2023 +0200
@@ -6,18 +6,17 @@
  * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
+ * General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  **/
 
 
@@ -607,4 +606,4 @@
     parentResources_.insert(resource);
   }
 
-}
\ No newline at end of file
+}
--- a/OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.h	Fri Apr 14 13:20:24 2023 +0200
+++ b/OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.h	Fri Apr 14 17:31:27 2023 +0200
@@ -6,18 +6,17 @@
  * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
+ * General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  **/
 
 
--- a/OrthancServer/Sources/ServerToolbox.cpp	Fri Apr 14 13:20:24 2023 +0200
+++ b/OrthancServer/Sources/ServerToolbox.cpp	Fri Apr 14 17:31:27 2023 +0200
@@ -274,10 +274,6 @@
 
         if (reconstructFiles)
         {
-          // preserve metadata from old resource
-          typedef std::map<MetadataType, std::string>  InstanceMetadata;
-          InstanceMetadata  instanceMetadata;
-
           std::string resultPublicId;  // ignored
           std::unique_ptr<DicomInstanceToStore> dicomInstancetoStore(DicomInstanceToStore::CreateFromParsedDicomFile(locker.GetDicom()));