comparison Core/DicomNetworking/Internals/MoveScp.cpp @ 3786:3801435e34a1 SylvainRouquette/fix-issue169-95b752c

integration Orthanc-1.6.0->SylvainRouquette
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 19 Mar 2020 11:48:30 +0100
parents 2a170a8f1faf
children
comparison
equal deleted inserted replaced
3785:763533d6dd67 3786:3801435e34a1
1 /** 1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store 2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium 4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium 5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
6 * 6 *
7 * This program is free software: you can redistribute it and/or 7 * This program is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as 8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation, either version 3 of the 9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version. 10 * License, or (at your option) any later version.
112 IMoveRequestHandler* handler_; 112 IMoveRequestHandler* handler_;
113 DcmDataset* lastRequest_; 113 DcmDataset* lastRequest_;
114 unsigned int subOperationCount_; 114 unsigned int subOperationCount_;
115 unsigned int failureCount_; 115 unsigned int failureCount_;
116 unsigned int warningCount_; 116 unsigned int warningCount_;
117 std::auto_ptr<IMoveRequestIterator> iterator_; 117 std::unique_ptr<IMoveRequestIterator> iterator_;
118 const std::string* remoteIp_; 118 const std::string* remoteIp_;
119 const std::string* remoteAet_; 119 const std::string* remoteAet_;
120 const std::string* calledAet_; 120 const std::string* calledAet_;
121 }; 121 };
122 122
270 T_DIMSE_Message * msg, 270 T_DIMSE_Message * msg,
271 T_ASC_PresentationContextID presID, 271 T_ASC_PresentationContextID presID,
272 IMoveRequestHandler& handler, 272 IMoveRequestHandler& handler,
273 const std::string& remoteIp, 273 const std::string& remoteIp,
274 const std::string& remoteAet, 274 const std::string& remoteAet,
275 const std::string& calledAet) 275 const std::string& calledAet,
276 int timeout)
276 { 277 {
277 MoveScpData data; 278 MoveScpData data;
278 data.target_ = std::string(msg->msg.CMoveRQ.MoveDestination); 279 data.target_ = std::string(msg->msg.CMoveRQ.MoveDestination);
279 data.lastRequest_ = NULL; 280 data.lastRequest_ = NULL;
280 data.handler_ = &handler; 281 data.handler_ = &handler;
282 data.remoteAet_ = &remoteAet; 283 data.remoteAet_ = &remoteAet;
283 data.calledAet_ = &calledAet; 284 data.calledAet_ = &calledAet;
284 285
285 OFCondition cond = DIMSE_moveProvider(assoc, presID, &msg->msg.CMoveRQ, 286 OFCondition cond = DIMSE_moveProvider(assoc, presID, &msg->msg.CMoveRQ,
286 MoveScpCallback, &data, 287 MoveScpCallback, &data,
287 /*opt_blockMode*/ DIMSE_BLOCKING, 288 /*opt_blockMode*/ (timeout ? DIMSE_NONBLOCKING : DIMSE_BLOCKING),
288 /*opt_dimse_timeout*/ 0); 289 /*opt_dimse_timeout*/ timeout);
289 290
290 // if some error occured, dump corresponding information and remove the outfile if necessary 291 // if some error occured, dump corresponding information and remove the outfile if necessary
291 if (cond.bad()) 292 if (cond.bad())
292 { 293 {
293 OFString temp_str; 294 OFString temp_str;