comparison Core/DicomNetworking/Internals/GetScp.cpp @ 3955:66879215cbf3 c-get

C-GET: add timeout, fix uninitalized priority, support multiple resources
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 20 May 2020 16:38:33 +0200
parents 67b457283499
children 76a24be12912
comparison
equal deleted inserted replaced
3954:67b457283499 3955:66879215cbf3
107 T_ASC_Association * assoc_; 107 T_ASC_Association * assoc_;
108 108
109 std::string remoteIp_; 109 std::string remoteIp_;
110 std::string remoteAet_; 110 std::string remoteAet_;
111 std::string calledAet_; 111 std::string calledAet_;
112 int timeout_;
112 113
113 GetScpData() 114 GetScpData()
114 { 115 {
115 handler_ = NULL; 116 handler_ = NULL;
116 lastRequest_ = NULL; 117 lastRequest_ = NULL;
160 DicomMap input; 161 DicomMap input;
161 FromDcmtkBridge::ExtractDicomSummary(input, *requestIdentifiers); 162 FromDcmtkBridge::ExtractDicomSummary(input, *requestIdentifiers);
162 163
163 try 164 try
164 { 165 {
165 if(!data.handler_->Handle(input, data.remoteIp_, data.remoteAet_, 166 if (!data.handler_->Handle(input, data.remoteIp_, data.remoteAet_, data.calledAet_,
166 data.calledAet_)) 167 data.timeout_ < 0 ? 0 : static_cast<uint32_t>(data.timeout_)))
167 { 168 {
168 response->DimseStatus = STATUS_GET_Failed_UnableToProcess; 169 response->DimseStatus = STATUS_GET_Failed_UnableToProcess;
169 return; 170 return;
170 } 171 }
171 } 172 }
266 data.handler_ = &handler; 267 data.handler_ = &handler;
267 data.assoc_ = assoc; 268 data.assoc_ = assoc;
268 data.remoteIp_ = remoteIp; 269 data.remoteIp_ = remoteIp;
269 data.remoteAet_ = remoteAet; 270 data.remoteAet_ = remoteAet;
270 data.calledAet_ = calledAet; 271 data.calledAet_ = calledAet;
272 data.timeout_ = timeout;
271 273
272 OFCondition cond = DIMSE_getProvider(assoc, presID, &msg->msg.CGetRQ, 274 OFCondition cond = DIMSE_getProvider(assoc, presID, &msg->msg.CGetRQ,
273 GetScpCallback, &data, 275 GetScpCallback, &data,
274 /*opt_blockMode*/ (timeout ? DIMSE_NONBLOCKING : DIMSE_BLOCKING), 276 /*opt_blockMode*/ (timeout ? DIMSE_NONBLOCKING : DIMSE_BLOCKING),
275 /*opt_dimse_timeout*/ timeout); 277 /*opt_dimse_timeout*/ timeout);