# HG changeset patch # User Sebastien Jodogne # Date 1500448202 -7200 # Node ID e2e5dde950275b97c146dc6e51d4b844e823186a # Parent 415450f11cc7ad8a97c08ad7003233f7fbe12c20# Parent 2421c137c3049f884f52e0c02718b276d12b3de7 merge diff -r 415450f11cc7 -r e2e5dde95027 OrthancServer/main.cpp --- a/OrthancServer/main.cpp Wed Jul 19 09:09:53 2017 +0200 +++ b/OrthancServer/main.cpp Wed Jul 19 09:10:02 2017 +0200 @@ -152,10 +152,13 @@ { private: ServerContext& context_; + bool alwaysAllowStore_; public: - OrthancApplicationEntityFilter(ServerContext& context) : context_(context) + OrthancApplicationEntityFilter(ServerContext& context) : + context_(context) { + alwaysAllowStore_ = Configuration::GetGlobalBoolParameter("DicomAlwaysAllowStore", true); } virtual bool IsAllowedConnection(const std::string& remoteIp, @@ -164,8 +167,9 @@ { LOG(INFO) << "Incoming connection from AET " << remoteAet << " on IP " << remoteIp << ", calling AET " << calledAet; - - return true; + + return (alwaysAllowStore_ || + Configuration::IsKnownAETitle(remoteAet, remoteIp)); } virtual bool IsAllowedRequest(const std::string& remoteIp, @@ -177,13 +181,12 @@ << remoteAet << " on IP " << remoteIp << ", calling AET " << calledAet; if (type == DicomRequestType_Store && - Configuration::GetGlobalBoolParameter("DicomAlwaysAllowStore", true)) + alwaysAllowStore_) { // Incoming store requests are always accepted, even from unknown AET return true; } - - if (!Configuration::IsKnownAETitle(remoteAet, remoteIp)) + else if (!Configuration::IsKnownAETitle(remoteAet, remoteIp)) { return false; }