# HG changeset patch # User Sebastien Jodogne # Date 1391605080 -3600 # Node ID c59bc408fb1052272013c98601ec74a84e1dbbce # Parent 72dc919a028c06f905d83a0971247439a6618f1f parameter to disable the computation of the MD5 diff -r 72dc919a028c -r c59bc408fb10 OrthancServer/ServerContext.cpp --- a/OrthancServer/ServerContext.cpp Wed Feb 05 13:26:19 2014 +0100 +++ b/OrthancServer/ServerContext.cpp Wed Feb 05 13:58:00 2014 +0100 @@ -269,4 +269,10 @@ return Store(resultPublicId, dicom.GetDicom(), dicomBuffer, dicomSize); } + void ServerContext::SetStoreMD5ForAttachments(bool storeMD5) + { + LOG(INFO) << "Storing MD5 for attachments: " << (storeMD5 ? "yes" : "no"); + accessor_.SetStoreMD5(storeMD5); + } + } diff -r 72dc919a028c -r c59bc408fb10 OrthancServer/ServerContext.h --- a/OrthancServer/ServerContext.h Wed Feb 05 13:26:19 2014 +0100 +++ b/OrthancServer/ServerContext.h Wed Feb 05 13:58:00 2014 +0100 @@ -137,5 +137,12 @@ { return lua_; } + + void SetStoreMD5ForAttachments(bool storeMD5); + + bool IsStoreMD5ForAttachments() const + { + return accessor_.IsStoreMD5(); + } }; } diff -r 72dc919a028c -r c59bc408fb10 OrthancServer/main.cpp --- a/OrthancServer/main.cpp Wed Feb 05 13:26:19 2014 +0100 +++ b/OrthancServer/main.cpp Wed Feb 05 13:58:00 2014 +0100 @@ -333,6 +333,7 @@ LOG(WARNING) << "Index directory: " << indexDirectory; context.SetCompressionEnabled(GetGlobalBoolParameter("StorageCompression", false)); + context.SetStoreMD5ForAttachments(GetGlobalBoolParameter("StoreMD5ForAttachments", true)); std::list luaScripts; GetGlobalListOfStringsParameter(luaScripts, "LuaScripts"); diff -r 72dc919a028c -r c59bc408fb10 Resources/Configuration.json --- a/Resources/Configuration.json Wed Feb 05 13:26:19 2014 +0100 +++ b/Resources/Configuration.json Wed Feb 05 13:58:00 2014 +0100 @@ -147,5 +147,11 @@ // By default, Orthanc compares AET (Application Entity Titles) in a // case-insensitive way. Setting this option to "true" will enable // case-sensitive matching. - "StrictAetComparison" : false + "StrictAetComparison" : false, + + // When the following option is "true", the MD5 of the DICOM files + // will be computed and stored in the Orthanc database. This + // information can be used to detect disk corruption, at the price + // of a small performance overhead. + "StoreMD5ForAttachments" : true }