comparison OrthancServer/main.cpp @ 941:83489fddd8c5

Options to limit the number of results for an incoming C-FIND query
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 25 Jun 2014 11:08:11 +0200
parents 84513f2ee1f3
children 3fb427ac3f53 c2c28dd17e87 e57e08ed510f cf52f3bcb2b3
comparison
equal deleted inserted replaced
940:4864b3e304be 941:83489fddd8c5
96 return new OrthancStoreRequestHandler(context_); 96 return new OrthancStoreRequestHandler(context_);
97 } 97 }
98 98
99 virtual IFindRequestHandler* ConstructFindRequestHandler() 99 virtual IFindRequestHandler* ConstructFindRequestHandler()
100 { 100 {
101 return new OrthancFindRequestHandler(context_); 101 std::auto_ptr<OrthancFindRequestHandler> result(new OrthancFindRequestHandler(context_));
102
103 result->SetMaxResults(Configuration::GetGlobalIntegerParameter("LimitFindResults", 0));
104 result->SetMaxInstances(Configuration::GetGlobalIntegerParameter("LimitFindInstances", 0));
105
106 if (result->GetMaxResults() == 0)
107 {
108 LOG(INFO) << "No limit on the number of C-FIND results at the Patient, Study and Series levels";
109 }
110 else
111 {
112 LOG(INFO) << "Maximum " << result->GetMaxResults()
113 << " results for C-FIND queries at the Patient, Study and Series levels";
114 }
115
116 if (result->GetMaxInstances() == 0)
117 {
118 LOG(INFO) << "No limit on the number of C-FIND results at the Instance level";
119 }
120 else
121 {
122 LOG(INFO) << "Maximum " << result->GetMaxInstances()
123 << " instances will be returned for C-FIND queries at the Instance level";
124 }
125
126 return result.release();
102 } 127 }
103 128
104 virtual IMoveRequestHandler* ConstructMoveRequestHandler() 129 virtual IMoveRequestHandler* ConstructMoveRequestHandler()
105 { 130 {
106 return new OrthancMoveRequestHandler(context_); 131 return new OrthancMoveRequestHandler(context_);