diff OrthancServer/main.cpp @ 943:3fb427ac3f53 plugins

integration mainline -> plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 25 Jun 2014 11:40:41 +0200
parents dcb2469f00f4 83489fddd8c5
children 564e39d6df13
line wrap: on
line diff
--- a/OrthancServer/main.cpp	Tue Jun 24 16:37:06 2014 +0200
+++ b/OrthancServer/main.cpp	Wed Jun 25 11:40:41 2014 +0200
@@ -100,7 +100,32 @@
 
   virtual IFindRequestHandler* ConstructFindRequestHandler()
   {
-    return new OrthancFindRequestHandler(context_);
+    std::auto_ptr<OrthancFindRequestHandler> result(new OrthancFindRequestHandler(context_));
+
+    result->SetMaxResults(Configuration::GetGlobalIntegerParameter("LimitFindResults", 0));
+    result->SetMaxInstances(Configuration::GetGlobalIntegerParameter("LimitFindInstances", 0));
+
+    if (result->GetMaxResults() == 0)
+    {
+      LOG(INFO) << "No limit on the number of C-FIND results at the Patient, Study and Series levels";
+    }
+    else
+    {
+      LOG(INFO) << "Maximum " << result->GetMaxResults() 
+                << " results for C-FIND queries at the Patient, Study and Series levels";
+    }
+
+    if (result->GetMaxInstances() == 0)
+    {
+      LOG(INFO) << "No limit on the number of C-FIND results at the Instance level";
+    }
+    else
+    {
+      LOG(INFO) << "Maximum " << result->GetMaxInstances() 
+                << " instances will be returned for C-FIND queries at the Instance level";
+    }
+
+    return result.release();
   }
 
   virtual IMoveRequestHandler* ConstructMoveRequestHandler()