# HG changeset patch # User Sebastien Jodogne # Date 1786551629 -7200 # Node ID bfd282b98d3a7537a7d1316b3e42cfc5e13b5f75 # Parent ecda882238064e7c5203bb4a671ff52558178089 compatibility with old versions of openssl and lua diff -r ecda88223806 -r bfd282b98d3a OrthancServer/Sources/OrthancRestApi/ThirdPartyVersions.cpp --- a/OrthancServer/Sources/OrthancRestApi/ThirdPartyVersions.cpp Wed Aug 12 18:00:20 2026 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/ThirdPartyVersions.cpp Wed Aug 12 18:20:29 2026 +0200 @@ -24,6 +24,8 @@ #include "../PrecompiledHeadersServer.h" #include "ThirdPartyVersions.h" +#include "../../../OrthancFramework/Sources/Toolbox.h" + #include #include #include @@ -78,14 +80,35 @@ boost::lexical_cast(PNG_LIBPNG_VER_MINOR) + "." + boost::lexical_cast(PNG_LIBPNG_VER_RELEASE)); +#if defined(LUA_VERSION_MAJOR) target["lua"] = (boost::lexical_cast(LUA_VERSION_MAJOR) + "." + boost::lexical_cast(LUA_VERSION_MINOR) + "." + boost::lexical_cast(LUA_VERSION_RELEASE)); +#else + target["lua"] = (boost::lexical_cast(LUA_VERSION_NUM / 100) + "." + + boost::lexical_cast(LUA_VERSION_NUM % 100)); +#endif #if ORTHANC_ENABLE_SSL == 1 +# if defined(OPENSSL_VERSION_MAJOR) target["openssl"] = (boost::lexical_cast(OPENSSL_VERSION_MAJOR) + "." + boost::lexical_cast(OPENSSL_VERSION_MINOR) + "." + boost::lexical_cast(OPENSSL_VERSION_PATCH)); +# else + { + // Backward compatibility for OpenSSL 1.x + std::vector v; + Toolbox::TokenizeString(v, OPENSSL_VERSION_TEXT, ' ' ); + if (v.size() >= 2) + { + target["openssl"] = v[1]; + } + else + { + target["openssl"] = "unknown"; + } + } +# endif #endif #if ORTHANC_ENABLE_PUGIXML == 1