comparison OrthancServer/Internals/FindScp.cpp @ 665:41b3e5ccb291

fix for medInria
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 07 Nov 2013 16:25:28 +0100
parents 08eca5d86aad
children 2d0a347e8cfc
comparison
equal deleted inserted replaced
664:855adbdd75a6 665:41b3e5ccb291
47 { 47 {
48 IFindRequestHandler* handler_; 48 IFindRequestHandler* handler_;
49 DicomMap input_; 49 DicomMap input_;
50 DicomFindAnswers answers_; 50 DicomFindAnswers answers_;
51 DcmDataset* lastRequest_; 51 DcmDataset* lastRequest_;
52 const std::string* callingAETitle_;
52 }; 53 };
53 54
54 55
55 void FindScpCallback( 56 void FindScpCallback(
56 /* in */ 57 /* in */
72 { 73 {
73 FromDcmtkBridge::Convert(data.input_, *requestIdentifiers); 74 FromDcmtkBridge::Convert(data.input_, *requestIdentifiers);
74 75
75 try 76 try
76 { 77 {
77 data.handler_->Handle(data.answers_, data.input_); 78 data.handler_->Handle(data.answers_, data.input_, *data.callingAETitle_);
78 } 79 }
79 catch (OrthancException& e) 80 catch (OrthancException& e)
80 { 81 {
81 // Internal error! 82 // Internal error!
82 LOG(ERROR) << "IFindRequestHandler Failed: " << e.What(); 83 LOG(ERROR) << "IFindRequestHandler Failed: " << e.What();
110 111
111 112
112 OFCondition Internals::findScp(T_ASC_Association * assoc, 113 OFCondition Internals::findScp(T_ASC_Association * assoc,
113 T_DIMSE_Message * msg, 114 T_DIMSE_Message * msg,
114 T_ASC_PresentationContextID presID, 115 T_ASC_PresentationContextID presID,
115 IFindRequestHandler& handler) 116 IFindRequestHandler& handler,
117 const std::string& callingAETitle)
116 { 118 {
117 FindScpData data; 119 FindScpData data;
118 data.lastRequest_ = NULL; 120 data.lastRequest_ = NULL;
119 data.handler_ = &handler; 121 data.handler_ = &handler;
122 data.callingAETitle_ = &callingAETitle;
120 123
121 OFCondition cond = DIMSE_findProvider(assoc, presID, &msg->msg.CFindRQ, 124 OFCondition cond = DIMSE_findProvider(assoc, presID, &msg->msg.CFindRQ,
122 FindScpCallback, &data, 125 FindScpCallback, &data,
123 /*opt_blockMode*/ DIMSE_BLOCKING, 126 /*opt_blockMode*/ DIMSE_BLOCKING,
124 /*opt_dimse_timeout*/ 0); 127 /*opt_dimse_timeout*/ 0);