Mercurial > hg > orthanc-object-storage
changeset 235:6a2f3fc566f6
back to mainline
| author | Alain Mazy <am@orthanc.team> |
|---|---|
| date | Mon, 13 Apr 2026 10:57:05 +0200 |
| parents | d0d686f3a643 (current diff) c3d9b76f6d0a (diff) |
| children | 5dea2c38b6be |
| files | Aws/CMakeLists.txt Azure/CMakeLists.txt Google/CMakeLists.txt |
| diffstat | 9 files changed, 68 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/Aws/CMakeLists.txt Wed Apr 08 15:56:52 2026 +0200 +++ b/Aws/CMakeLists.txt Mon Apr 13 10:57:05 2026 +0200 @@ -27,7 +27,7 @@ set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() - set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.12.4") + set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.12.10") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif()
--- a/Azure/CMakeLists.txt Wed Apr 08 15:56:52 2026 +0200 +++ b/Azure/CMakeLists.txt Mon Apr 13 10:57:05 2026 +0200 @@ -27,7 +27,7 @@ set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() - set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.12.4") + set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.12.10") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif()
--- a/Common/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake Wed Apr 08 15:56:52 2026 +0200 +++ b/Common/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake Mon Apr 13 10:57:05 2026 +0200 @@ -231,6 +231,11 @@ # for BlockingSharedMessageQueue.WaitEmpty() set(ORTHANC_FRAMEWORK_PRE_RELEASE ON) set(ORTHANC_FRAMEWORK_MD5 "c037cd2ddbe1b65b431692855483161b") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "56eb61c86f93") + # OE2 1.11.0 (framework post-1.12.10) + # for HttpClient that returns the answer body in case of HTTP error + set(ORTHANC_FRAMEWORK_PRE_RELEASE ON) + set(ORTHANC_FRAMEWORK_MD5 "665f8aa70d7c5091bc20da37cf664910") endif() endif() endif()
--- a/Common/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Wed Apr 08 15:56:52 2026 +0200 +++ b/Common/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Mon Apr 13 10:57:05 2026 +0200 @@ -1544,11 +1544,25 @@ #endif /* HAS_ORTHANC_PLUGIN_FIND_MATCHER == 1 */ + static void CheckAnswerSizeIsLessThan4GB(const std::string& answer) + { + if (answer.size() > static_cast<size_t>(std::numeric_limits<uint32_t>::max())) + { + #if HAS_ORTHANC_EXCEPTION == 1 + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange, "Cannot send HTTP response larger than 4GB"); + #else + ORTHANC_PLUGINS_LOG_ERROR("Cannot send HTTP response larger than 4GB"); + ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); + #endif + } + } + void AnswerJson(const Json::Value& value, OrthancPluginRestOutput* output) { std::string bodyString; - WriteStyledJson(bodyString, value); + WriteStyledJson(bodyString, value); + CheckAnswerSizeIsLessThan4GB(bodyString); OrthancPluginAnswerBuffer(GetGlobalContext(), output, bodyString.c_str(), bodyString.size(), "application/json"); } @@ -1556,6 +1570,7 @@ const char* mimeType, OrthancPluginRestOutput* output) { + CheckAnswerSizeIsLessThan4GB(answer); OrthancPluginAnswerBuffer(GetGlobalContext(), output, answer.c_str(), answer.size(), mimeType); } @@ -1564,6 +1579,26 @@ OrthancPluginSendHttpStatusCode(GetGlobalContext(), output, httpError); } + void AnswerHttpError(uint16_t httpError, + OrthancPluginRestOutput* output, + const std::string& answer, + const char* mimeType) + { + CheckAnswerSizeIsLessThan4GB(answer); + + OrthancPluginSetHttpHeader(GetGlobalContext(), + output, + "content-type", + mimeType); + + OrthancPluginSendHttpStatus(GetGlobalContext(), + output, + httpError, + answer.c_str(), + static_cast<uint32_t>(answer.size())); + } + + void AnswerMethodNotAllowed(OrthancPluginRestOutput *output, const char* allowedMethods) { OrthancPluginSendMethodNotAllowed(GetGlobalContext(), output, allowedMethods);
--- a/Common/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h Wed Apr 08 15:56:52 2026 +0200 +++ b/Common/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h Mon Apr 13 10:57:05 2026 +0200 @@ -690,6 +690,11 @@ void AnswerHttpError(uint16_t httpError, OrthancPluginRestOutput* output); + void AnswerHttpError(uint16_t httpError, + OrthancPluginRestOutput* output, + const std::string& answer, + const char* mimeType); + void AnswerMethodNotAllowed(OrthancPluginRestOutput* output, const char* allowedMethods); #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 0) @@ -1025,7 +1030,20 @@ OrthancPluginSetMetricsValue(GetGlobalContext(), name, value, OrthancPluginMetricsType_Default); } +#endif + +#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 1) + inline void SetMetricsValue(const char* name, + int64_t value) + { + OrthancPluginSetMetricsIntegerValue(GetGlobalContext(), name, + value, OrthancPluginMetricsType_Default); + } +#endif + + +#if HAS_ORTHANC_PLUGIN_METRICS == 1 class MetricsTimer : public boost::noncopyable { private:
--- a/Common/StoragePlugin.cpp Wed Apr 08 15:56:52 2026 +0200 +++ b/Common/StoragePlugin.cpp Mon Apr 13 10:57:05 2026 +0200 @@ -168,7 +168,7 @@ } catch (StoragePluginException& ex) { - logErrorFunction(std::string(StoragePluginFactory::GetStoragePluginName()) + ": error while reading object " + std::string(uuid) + ": " + std::string(ex.what())); + logErrorFunction(storage->GetNameForLogs() + ": failed to read object " + std::string(uuid) + ": " + std::string(ex.what())); return OrthancPluginErrorCode_StorageAreaPlugin; } } @@ -261,7 +261,7 @@ } catch (StoragePluginException& ex) { - logErrorFunction(storage->GetNameForLogs() + ": error while reading object " + std::string(uuid) + ": " + ex.what()); + logErrorFunction(storage->GetNameForLogs() + ": failed to read object " + std::string(uuid) + ": " + ex.what()); return OrthancPluginErrorCode_StorageAreaPlugin; } @@ -327,7 +327,7 @@ } catch (StoragePluginException& ex) { - logErrorFunction(std::string(StoragePluginFactory::GetStoragePluginName()) + ": error while deleting object " + std::string(uuid) + ": " + std::string(ex.what())); + logErrorFunction(storage->GetNameForLogs() + ": failed to delete object " + std::string(uuid) + ": " + std::string(ex.what())); return OrthancPluginErrorCode_StorageAreaPlugin; } }
--- a/Google/CMakeLists.txt Wed Apr 08 15:56:52 2026 +0200 +++ b/Google/CMakeLists.txt Mon Apr 13 10:57:05 2026 +0200 @@ -27,7 +27,7 @@ set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() - set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.12.4") + set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.12.10") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif()
--- a/NEWS Wed Apr 08 15:56:52 2026 +0200 +++ b/NEWS Mon Apr 13 10:57:05 2026 +0200 @@ -1,5 +1,5 @@ -Pending changes in the mainline -=============================== +2026-04-13 - v 2.5.2 +==================== * AWS plugin: * "ConnectTimeout" has been renamed into "ConnectionTimeout" to match the documentation.
--- a/TODO Wed Apr 08 15:56:52 2026 +0200 +++ b/TODO Mon Apr 13 10:57:05 2026 +0200 @@ -1,4 +1,4 @@ -- Remove false Error log when working in hybrid mode +- Remove false Error log when working in hybrid mode (note: at least for S3, it now appears as a warning with the correct 'primary' or 'secondary' storage name) https://discourse.orthanc-server.org/t/object-storage-hybrid-mode/5218 - Investigate use of soft-delete with Google Cloud Storage
