Mercurial > hg > orthanc
changeset 5878:e08438a558b0
merge
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Thu, 21 Nov 2024 12:52:35 +0100 (2 months ago) |
parents | ff0b54e8bc71 (current diff) 2701b450060c (diff) |
children | 1e51e6299f7a |
files | NEWS |
diffstat | 3 files changed, 23 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS Thu Nov 21 12:51:26 2024 +0100 +++ b/NEWS Thu Nov 21 12:52:35 2024 +0100 @@ -31,6 +31,8 @@ at the same time. * Fix crashes if handling very large images. * Fix deadlock when parsing specific invalid DICOM files. +* Loading plugins: + - Orthanc will now fail to start when provided with a plugin path that can not be found. * Metrics: - fix a few metrics that were not published - added 2 metrics: orthanc_storage_cache_miss_count & orthanc_storage_cache_hit_count
--- a/OrthancServer/Plugins/Engine/PluginsManager.cpp Thu Nov 21 12:51:26 2024 +0100 +++ b/OrthancServer/Plugins/Engine/PluginsManager.cpp Thu Nov 21 12:52:35 2024 +0100 @@ -244,8 +244,21 @@ { if (!boost::filesystem::exists(path)) { - LOG(ERROR) << "Inexistent path to plugins: " << path; - return; + boost::filesystem::path p(path); + std::string extension = p.extension().string(); + Toolbox::ToLowerCase(extension); + + if (extension == PLUGIN_EXTENSION) + { + // if this is a plugin path, fail to start + throw OrthancException(ErrorCode_SharedLibrary, "Inexistent path to plugin: " + path); + } + else + { + // it might be a directory -> just log a warning + LOG(WARNING) << "Inexistent path to plugins: " << path; + return; + } } if (boost::filesystem::is_directory(path))
--- a/TODO Thu Nov 21 12:51:26 2024 +0100 +++ b/TODO Thu Nov 21 12:52:35 2024 +0100 @@ -284,6 +284,12 @@ https://groups.google.com/g/orthanc-users/c/ymtaAmgSs6Q/m/PqVBactQAQAJ * Add an index on the UUID column in the DelayedDeletion plugin: https://discourse.orthanc-server.org/t/delayeddeletion-improvement-unique-index-on-pending-uuid-column/4032 +* Orthanc shall refuse to start if one registers 2 storage plugins. + Right now, this is not possible because OrthancPluginRegisterStorageArea2 does not return any value + and it can not throw an Exception because that's a core function called from a plugin -> the Exception + can not cross the C/C++ frontier safely -> we need a OrthancPluginRegisterStorageArea3 with a return value. + Ex: install DelayedDeletion + S3 storage. Right now, the second plugin to load is just ignored with an error + message in the logs. -----------