Mercurial > hg > orthanc
comparison OrthancServer/OrthancInitialization.cpp @ 2800:dc7330089736
"OrthancPeers" configuration option now allows to specify HTTP headers
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 23 Aug 2018 13:11:48 +0200 |
parents | 6e3a60b85da6 |
children | 3ee82c7313e7 |
comparison
equal
deleted
inserted
replaced
2799:6e3a60b85da6 | 2800:dc7330089736 |
---|---|
275 Configuration::GetListOfOrthancPeers(ids); | 275 Configuration::GetListOfOrthancPeers(ids); |
276 for (std::set<std::string>::const_iterator it = ids.begin(); it != ids.end(); ++it) | 276 for (std::set<std::string>::const_iterator it = ids.begin(); it != ids.end(); ++it) |
277 { | 277 { |
278 WebServiceParameters peer; | 278 WebServiceParameters peer; |
279 Configuration::GetOrthancPeer(peer, *it); | 279 Configuration::GetOrthancPeer(peer, *it); |
280 peer.CheckClientCertificate(); | |
280 } | 281 } |
281 | 282 |
282 Configuration::GetListOfDicomModalities(ids); | 283 Configuration::GetListOfDicomModalities(ids); |
283 for (std::set<std::string>::const_iterator it = ids.begin(); it != ids.end(); ++it) | 284 for (std::set<std::string>::const_iterator it = ids.begin(); it != ids.end(); ++it) |
284 { | 285 { |
626 { | 627 { |
627 return false; | 628 return false; |
628 } | 629 } |
629 else | 630 else |
630 { | 631 { |
631 peer.FromJson(modalities[name]); | 632 peer.Unserialize(modalities[name]); |
632 return true; | 633 return true; |
633 } | 634 } |
634 } | 635 } |
635 catch (OrthancException&) | 636 catch (OrthancException&) |
636 { | 637 { |
940 | 941 |
941 | 942 |
942 void Configuration::UpdatePeer(const std::string& symbolicName, | 943 void Configuration::UpdatePeer(const std::string& symbolicName, |
943 const WebServiceParameters& peer) | 944 const WebServiceParameters& peer) |
944 { | 945 { |
946 peer.CheckClientCertificate(); | |
947 | |
945 boost::recursive_mutex::scoped_lock lock(globalMutex_); | 948 boost::recursive_mutex::scoped_lock lock(globalMutex_); |
946 | 949 |
947 if (!configuration_.isMember("OrthancPeers")) | 950 if (!configuration_.isMember("OrthancPeers")) |
948 { | 951 { |
949 LOG(ERROR) << "No peer with symbolic name: " << symbolicName; | 952 LOG(ERROR) << "No peer with symbolic name: " << symbolicName; |
958 } | 961 } |
959 | 962 |
960 peers.removeMember(symbolicName); | 963 peers.removeMember(symbolicName); |
961 | 964 |
962 Json::Value v; | 965 Json::Value v; |
963 peer.ToJson(v, true); | 966 peer.Serialize(v, |
967 false /* use simple format if possible */, | |
968 true /* include passwords */); | |
964 peers[symbolicName] = v; | 969 peers[symbolicName] = v; |
965 } | 970 } |
966 | 971 |
967 | 972 |
968 void Configuration::RemovePeer(const std::string& symbolicName) | 973 void Configuration::RemovePeer(const std::string& symbolicName) |