Mercurial > hg > orthanc
diff OrthancServer/Sources/ServerContext.cpp @ 4473:68f52897c119
new URIs: /tools/accepted-transfer-syntaxes and /tools/unknown-sop-class-accepted to replace Lua callbacks for transfer syntaxes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 26 Jan 2021 14:48:10 +0100 |
parents | fe774d8e904b |
children | 6f99949b2878 |
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerContext.cpp Tue Jan 26 10:18:50 2021 +0100 +++ b/OrthancServer/Sources/ServerContext.cpp Tue Jan 26 14:48:10 2021 +0100 @@ -391,7 +391,7 @@ CLOG(INFO, DICOM) << "Deidentification of log contents (notably for DIMSE queries) is disabled"; } - // New option in Orthanc 1.9.0 + // New options in Orthanc 1.9.0 if (lock.GetConfiguration().LookupStringParameter(s, "DicomScuPreferredTransferSyntax") && !LookupTransferSyntax(preferredTransferSyntax_, s)) { @@ -401,6 +401,10 @@ CLOG(INFO, DICOM) << "Preferred transfer syntax for Orthanc C-STORE SCU: " << GetTransferSyntaxUid(preferredTransferSyntax_); + + lock.GetConfiguration().GetAcceptedTransferSyntaxes(acceptedTransferSyntaxes_); + + isUnknownSopClassAccepted_ = lock.GetConfiguration().GetBooleanParameter("UnknownSopClassAccepted", false); } jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200); @@ -1794,4 +1798,32 @@ return element.GetValue().GetContent(); } } + + + void ServerContext::GetAcceptedTransferSyntaxes(std::set<DicomTransferSyntax>& syntaxes) + { + boost::mutex::scoped_lock lock(dynamicOptionsMutex_); + syntaxes = acceptedTransferSyntaxes_; + } + + + void ServerContext::SetAcceptedTransferSyntaxes(const std::set<DicomTransferSyntax>& syntaxes) + { + boost::mutex::scoped_lock lock(dynamicOptionsMutex_); + acceptedTransferSyntaxes_ = syntaxes; + } + + + bool ServerContext::IsUnknownSopClassAccepted() + { + boost::mutex::scoped_lock lock(dynamicOptionsMutex_); + return isUnknownSopClassAccepted_; + } + + + void ServerContext::SetUnknownSopClassAccepted(bool accepted) + { + boost::mutex::scoped_lock lock(dynamicOptionsMutex_); + isUnknownSopClassAccepted_ = accepted; + } }