comparison OrthancServer/ServerContext.cpp @ 1574:0c29ebe80ac9

give access to full request origin in ReceivedInstanceFilter (Lua)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 25 Aug 2015 13:37:57 +0200
parents 2c7d5eb588e6
children bd1889029cbb
comparison
equal deleted inserted replaced
1573:3309878b3e16 1574:0c29ebe80ac9
184 StorageAccessor accessor(area_); 184 StorageAccessor accessor(area_);
185 185
186 DicomInstanceHasher hasher(dicom.GetSummary()); 186 DicomInstanceHasher hasher(dicom.GetSummary());
187 resultPublicId = hasher.HashInstance(); 187 resultPublicId = hasher.HashInstance();
188 188
189 Json::Value simplified; 189 Json::Value simplifiedTags;
190 SimplifyTags(simplified, dicom.GetJson()); 190 SimplifyTags(simplifiedTags, dicom.GetJson());
191 191
192 // Test if the instance must be filtered out 192 // Test if the instance must be filtered out
193 bool accepted = true; 193 bool accepted = true;
194 194
195 { 195 {
197 197
198 for (ServerListeners::iterator it = listeners_.begin(); it != listeners_.end(); ++it) 198 for (ServerListeners::iterator it = listeners_.begin(); it != listeners_.end(); ++it)
199 { 199 {
200 try 200 try
201 { 201 {
202 if (!it->GetListener().FilterIncomingInstance(simplified, dicom.GetRemoteAet())) 202 if (!it->GetListener().FilterIncomingInstance(dicom, simplifiedTags))
203 { 203 {
204 accepted = false; 204 accepted = false;
205 break; 205 break;
206 } 206 }
207 } 207 }
279 279
280 for (ServerListeners::iterator it = listeners_.begin(); it != listeners_.end(); ++it) 280 for (ServerListeners::iterator it = listeners_.begin(); it != listeners_.end(); ++it)
281 { 281 {
282 try 282 try
283 { 283 {
284 it->GetListener().SignalStoredInstance(resultPublicId, dicom, simplified); 284 it->GetListener().SignalStoredInstance(resultPublicId, dicom, simplifiedTags);
285 } 285 }
286 catch (OrthancException& e) 286 catch (OrthancException& e)
287 { 287 {
288 LOG(ERROR) << "Error in the " << it->GetDescription() 288 LOG(ERROR) << "Error in the " << it->GetDescription()
289 << " callback while receiving an instance: " << e.What(); 289 << " callback while receiving an instance: " << e.What();