# HG changeset patch # User Sebastien Jodogne # Date 1522229307 -7200 # Node ID 9d269d7cfeb88713cd184ab69f9467f6a04a8cae # Parent 431e991af593002e9d7c0c50e43626daeee84784 sync diff -r 431e991af593 -r 9d269d7cfeb8 Resources/Orthanc/Core/Cache/MemoryCache.cpp --- a/Resources/Orthanc/Core/Cache/MemoryCache.cpp Tue Mar 27 11:12:50 2018 +0200 +++ b/Resources/Orthanc/Core/Cache/MemoryCache.cpp Wed Mar 28 11:28:27 2018 +0200 @@ -78,6 +78,15 @@ { } + void MemoryCache::Invalidate(const std::string& id) + { + if (index_.Contains(id)) + { + VLOG(1) << "Invalidating a cache page"; + index_.Invalidate(id); + } + } + MemoryCache::~MemoryCache() { while (!index_.IsEmpty()) diff -r 431e991af593 -r 9d269d7cfeb8 Resources/Orthanc/Core/Cache/MemoryCache.h --- a/Resources/Orthanc/Core/Cache/MemoryCache.h Tue Mar 27 11:12:50 2018 +0200 +++ b/Resources/Orthanc/Core/Cache/MemoryCache.h Wed Mar 28 11:28:27 2018 +0200 @@ -64,5 +64,7 @@ ~MemoryCache(); IDynamicObject& Access(const std::string& id); + + void Invalidate(const std::string& id); }; } diff -r 431e991af593 -r 9d269d7cfeb8 Resources/Orthanc/Core/Compression/DeflateBaseCompressor.h --- a/Resources/Orthanc/Core/Compression/DeflateBaseCompressor.h Tue Mar 27 11:12:50 2018 +0200 +++ b/Resources/Orthanc/Core/Compression/DeflateBaseCompressor.h Wed Mar 28 11:28:27 2018 +0200 @@ -35,6 +35,15 @@ #include "IBufferCompressor.h" +#if !defined(ORTHANC_ENABLE_ZLIB) +# error The macro ORTHANC_ENABLE_ZLIB must be defined +#endif + +#if ORTHANC_ENABLE_ZLIB != 1 +# error ZLIB support must be enabled to include this file +#endif + + #include namespace Orthanc diff -r 431e991af593 -r 9d269d7cfeb8 Resources/Orthanc/Core/Compression/ZipWriter.h --- a/Resources/Orthanc/Core/Compression/ZipWriter.h Tue Mar 27 11:12:50 2018 +0200 +++ b/Resources/Orthanc/Core/Compression/ZipWriter.h Wed Mar 28 11:28:27 2018 +0200 @@ -33,6 +33,15 @@ #pragma once +#if !defined(ORTHANC_ENABLE_ZLIB) +# error The macro ORTHANC_ENABLE_ZLIB must be defined +#endif + +#if ORTHANC_ENABLE_ZLIB != 1 +# error ZLIB support must be enabled to include this file +#endif + + #include #include #include diff -r 431e991af593 -r 9d269d7cfeb8 Resources/Orthanc/Resources/CMake/OrthancFrameworkConfiguration.cmake --- a/Resources/Orthanc/Resources/CMake/OrthancFrameworkConfiguration.cmake Tue Mar 27 11:12:50 2018 +0200 +++ b/Resources/Orthanc/Resources/CMake/OrthancFrameworkConfiguration.cmake Wed Mar 28 11:28:27 2018 +0200 @@ -71,6 +71,11 @@ add_definitions(-DORTHANC_ENABLE_JPEG=0) endif() +if (NOT ENABLE_ZLIB) + unset(USE_SYSTEM_ZLIB CACHE) + add_definitions(-DORTHANC_ENABLE_ZLIB=0) +endif() + if (NOT ENABLE_PNG) unset(USE_SYSTEM_LIBPNG CACHE) add_definitions(-DORTHANC_ENABLE_PNG=0) @@ -117,11 +122,6 @@ set(ORTHANC_CORE_SOURCES_INTERNAL ${ORTHANC_ROOT}/Core/Cache/MemoryCache.cpp ${ORTHANC_ROOT}/Core/ChunkedBuffer.cpp - ${ORTHANC_ROOT}/Core/Compression/DeflateBaseCompressor.cpp - ${ORTHANC_ROOT}/Core/Compression/GzipCompressor.cpp - ${ORTHANC_ROOT}/Core/Compression/HierarchicalZipWriter.cpp - ${ORTHANC_ROOT}/Core/Compression/ZipWriter.cpp - ${ORTHANC_ROOT}/Core/Compression/ZlibCompressor.cpp ${ORTHANC_ROOT}/Core/DicomFormat/DicomArray.cpp ${ORTHANC_ROOT}/Core/DicomFormat/DicomImageInformation.cpp ${ORTHANC_ROOT}/Core/DicomFormat/DicomInstanceHasher.cpp @@ -269,10 +269,36 @@ ## +## zlib support +## + +if (ENABLE_ZLIB) + include(${CMAKE_CURRENT_LIST_DIR}/ZlibConfiguration.cmake) + add_definitions(-DORTHANC_ENABLE_ZLIB=1) + + list(APPEND ORTHANC_CORE_SOURCES_INTERNAL + ${ORTHANC_ROOT}/Core/Compression/DeflateBaseCompressor.cpp + ${ORTHANC_ROOT}/Core/Compression/HierarchicalZipWriter.cpp + ${ORTHANC_ROOT}/Core/Compression/GzipCompressor.cpp + ${ORTHANC_ROOT}/Core/Compression/ZipWriter.cpp + ${ORTHANC_ROOT}/Core/Compression/ZlibCompressor.cpp + + # This is the minizip distribution to create ZIP files using zlib + ${ORTHANC_ROOT}/Resources/ThirdParty/minizip/ioapi.c + ${ORTHANC_ROOT}/Resources/ThirdParty/minizip/zip.c + ) +endif() + + +## ## PNG support: libpng (in conjunction with zlib) ## if (ENABLE_PNG) + if (NOT ENABLE_ZLIB) + message(FATAL_ERROR "Support for zlib must be enabled if enabling libpng support") + endif() + include(${CMAKE_CURRENT_LIST_DIR}/LibPngConfiguration.cmake) add_definitions(-DORTHANC_ENABLE_PNG=1) @@ -333,7 +359,6 @@ ##################################################################### include(${CMAKE_CURRENT_LIST_DIR}/JsonCppConfiguration.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/ZlibConfiguration.cmake) if (NOT ORTHANC_SANDBOXED) include(${CMAKE_CURRENT_LIST_DIR}/UuidConfiguration.cmake) @@ -509,10 +534,6 @@ ${ORTHANC_ROOT}/Resources/ThirdParty/md5/md5.c ${ORTHANC_ROOT}/Resources/ThirdParty/base64/base64.cpp - - # This is the minizip distribution to create ZIP files using zlib - ${ORTHANC_ROOT}/Resources/ThirdParty/minizip/ioapi.c - ${ORTHANC_ROOT}/Resources/ThirdParty/minizip/zip.c ) set(ORTHANC_CORE_SOURCES diff -r 431e991af593 -r 9d269d7cfeb8 Resources/Orthanc/Resources/CMake/OrthancFrameworkParameters.cmake --- a/Resources/Orthanc/Resources/CMake/OrthancFrameworkParameters.cmake Tue Mar 27 11:12:50 2018 +0200 +++ b/Resources/Orthanc/Resources/CMake/OrthancFrameworkParameters.cmake Wed Mar 28 11:28:27 2018 +0200 @@ -93,6 +93,7 @@ set(ENABLE_PNG OFF CACHE INTERNAL "Enable support of PNG") set(ENABLE_PUGIXML OFF CACHE INTERNAL "Enable support of XML through Pugixml") set(ENABLE_SQLITE OFF CACHE INTERNAL "Enable support of SQLite databases") +set(ENABLE_ZLIB OFF CACHE INTERNAL "Enable support of zlib") set(ENABLE_WEB_CLIENT OFF CACHE INTERNAL "Enable Web client") set(ENABLE_WEB_SERVER OFF CACHE INTERNAL "Enable embedded Web server") set(ENABLE_DCMTK OFF CACHE INTERNAL "Enable DCMTK")