Mercurial > hg > orthanc
comparison OrthancServer/main.cpp @ 4036:c6e82885f570
merge
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Wed, 10 Jun 2020 10:28:15 +0200 |
parents | e3b3af80732d |
children |
comparison
equal
deleted
inserted
replaced
4035:cc6ed76bba27 | 4036:c6e82885f570 |
---|---|
39 #include "../Core/Compatibility.h" | 39 #include "../Core/Compatibility.h" |
40 #include "../Core/DicomFormat/DicomArray.h" | 40 #include "../Core/DicomFormat/DicomArray.h" |
41 #include "../Core/DicomNetworking/DicomAssociationParameters.h" | 41 #include "../Core/DicomNetworking/DicomAssociationParameters.h" |
42 #include "../Core/DicomNetworking/DicomServer.h" | 42 #include "../Core/DicomNetworking/DicomServer.h" |
43 #include "../Core/DicomParsing/FromDcmtkBridge.h" | 43 #include "../Core/DicomParsing/FromDcmtkBridge.h" |
44 #include "../Core/HttpServer/EmbeddedResourceHttpHandler.h" | |
45 #include "../Core/HttpServer/FilesystemHttpHandler.h" | 44 #include "../Core/HttpServer/FilesystemHttpHandler.h" |
46 #include "../Core/HttpServer/HttpServer.h" | 45 #include "../Core/HttpServer/HttpServer.h" |
47 #include "../Core/Logging.h" | 46 #include "../Core/Logging.h" |
48 #include "../Core/Lua/LuaFunctionCall.h" | 47 #include "../Core/Lua/LuaFunctionCall.h" |
49 #include "../Plugins/Engine/OrthancPlugins.h" | 48 #include "../Plugins/Engine/OrthancPlugins.h" |
49 #include "EmbeddedResourceHttpHandler.h" | |
50 #include "OrthancConfiguration.h" | 50 #include "OrthancConfiguration.h" |
51 #include "OrthancFindRequestHandler.h" | 51 #include "OrthancFindRequestHandler.h" |
52 #include "OrthancGetRequestHandler.h" | |
52 #include "OrthancInitialization.h" | 53 #include "OrthancInitialization.h" |
53 #include "OrthancMoveRequestHandler.h" | 54 #include "OrthancMoveRequestHandler.h" |
54 #include "OrthancGetRequestHandler.h" | |
55 #include "ServerContext.h" | 55 #include "ServerContext.h" |
56 #include "ServerJobs/StorageCommitmentScpJob.h" | 56 #include "ServerJobs/StorageCommitmentScpJob.h" |
57 #include "ServerToolbox.h" | 57 #include "ServerToolbox.h" |
58 #include "StorageCommitmentReports.h" | 58 #include "StorageCommitmentReports.h" |
59 | 59 |
1150 } | 1150 } |
1151 #endif | 1151 #endif |
1152 | 1152 |
1153 // Secondly, apply the "static resources" layer | 1153 // Secondly, apply the "static resources" layer |
1154 #if ORTHANC_STANDALONE == 1 | 1154 #if ORTHANC_STANDALONE == 1 |
1155 EmbeddedResourceHttpHandler staticResources("/app", EmbeddedResources::ORTHANC_EXPLORER); | 1155 EmbeddedResourceHttpHandler staticResources("/app", ServerResources::ORTHANC_EXPLORER); |
1156 #else | 1156 #else |
1157 FilesystemHttpHandler staticResources("/app", ORTHANC_PATH "/OrthancExplorer"); | 1157 FilesystemHttpHandler staticResources("/app", ORTHANC_PATH "/OrthancExplorer"); |
1158 #endif | 1158 #endif |
1159 | 1159 |
1160 context.GetHttpHandler().Register(staticResources, false); | 1160 context.GetHttpHandler().Register(staticResources, false); |
1564 } | 1564 } |
1565 else if (boost::starts_with(argument, "--config=")) | 1565 else if (boost::starts_with(argument, "--config=")) |
1566 { | 1566 { |
1567 // TODO WHAT IS THE ENCODING? | 1567 // TODO WHAT IS THE ENCODING? |
1568 std::string configurationSample; | 1568 std::string configurationSample; |
1569 GetFileResource(configurationSample, EmbeddedResources::CONFIGURATION_SAMPLE); | 1569 GetFileResource(configurationSample, ServerResources::CONFIGURATION_SAMPLE); |
1570 | 1570 |
1571 #if defined(_WIN32) | 1571 #if defined(_WIN32) |
1572 // Replace UNIX newlines with DOS newlines | 1572 // Replace UNIX newlines with DOS newlines |
1573 boost::replace_all(configurationSample, "\n", "\r\n"); | 1573 boost::replace_all(configurationSample, "\n", "\r\n"); |
1574 #endif | 1574 #endif |
1708 { | 1708 { |
1709 LOG(ERROR) << "Native exception, stopping now. Check your plugins, if any."; | 1709 LOG(ERROR) << "Native exception, stopping now. Check your plugins, if any."; |
1710 status = -1; | 1710 status = -1; |
1711 } | 1711 } |
1712 | 1712 |
1713 LOG(WARNING) << "Orthanc has stopped"; | |
1714 | |
1713 OrthancFinalize(); | 1715 OrthancFinalize(); |
1714 | |
1715 LOG(WARNING) << "Orthanc has stopped"; | |
1716 | |
1717 Logging::Finalize(); | |
1718 | 1716 |
1719 return status; | 1717 return status; |
1720 } | 1718 } |