Mercurial > hg > orthanc
comparison OrthancServer/Sources/OrthancGetRequestHandler.cpp @ 4286:526bd8bad850
debug logs for C-MOVE and C-GET SCP
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 04 Nov 2020 17:40:25 +0100 |
parents | c7bd2f21ccc3 |
children | 5a3374b6e707 |
comparison
equal
deleted
inserted
replaced
4285:544120b34c09 | 4286:526bd8bad850 |
---|---|
51 | 51 |
52 #include <sstream> // For std::stringstream | 52 #include <sstream> // For std::stringstream |
53 | 53 |
54 namespace Orthanc | 54 namespace Orthanc |
55 { | 55 { |
56 namespace | 56 static void ProgressCallback(void *callbackData, |
57 { | 57 T_DIMSE_StoreProgress *progress, |
58 // Anonymous namespace to avoid clashes between compilation modules | 58 T_DIMSE_C_StoreRQ *req) |
59 | 59 { |
60 static void GetSubOpProgressCallback( | 60 if (req != NULL && |
61 void * /* callbackData == pointer to the "OrthancGetRequestHandler" object */, | 61 progress->state == DIMSE_StoreBegin) |
62 T_DIMSE_StoreProgress *progress, | 62 { |
63 T_DIMSE_C_StoreRQ * /*req*/) | 63 OFString str; |
64 { | 64 CLOG(TRACE, DICOM) << "Sending Store Request following a C-GET:" << std::endl |
65 // SBL - no logging to be done here. | 65 << DIMSE_dumpMessage(str, *req, DIMSE_OUTGOING); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 | 69 |
70 bool OrthancGetRequestHandler::DoNext(T_ASC_Association* assoc) | 70 bool OrthancGetRequestHandler::DoNext(T_ASC_Association* assoc) |
149 { | 149 { |
150 DicomTransferSyntax transferSyntax; | 150 DicomTransferSyntax transferSyntax; |
151 if (pc->result == ASC_P_ACCEPTANCE && | 151 if (pc->result == ASC_P_ACCEPTANCE && |
152 LookupTransferSyntax(transferSyntax, pc->acceptedTransferSyntax)) | 152 LookupTransferSyntax(transferSyntax, pc->acceptedTransferSyntax)) |
153 { | 153 { |
154 CLOG(TRACE, DICOM) << "C-GET SCP accepted: SOP class " << sopClassUid | 154 /*CLOG(TRACE, DICOM) << "C-GET SCP accepted: SOP class " << pc->abstractSyntax |
155 << " with transfer syntax " << GetTransferSyntaxUid(transferSyntax); | 155 << " with transfer syntax " << GetTransferSyntaxUid(transferSyntax);*/ |
156 if (std::string(pc->abstractSyntax) == sopClassUid) | 156 if (std::string(pc->abstractSyntax) == sopClassUid) |
157 { | 157 { |
158 accepted[transferSyntax] = pc->presentationContextID; | 158 accepted[transferSyntax] = pc->presentationContextID; |
159 } | 159 } |
160 } | 160 } |
309 { | 309 { |
310 // No transcoding is required | 310 // No transcoding is required |
311 DcmDataset *stDetailTmp = NULL; | 311 DcmDataset *stDetailTmp = NULL; |
312 cond = DIMSE_storeUser( | 312 cond = DIMSE_storeUser( |
313 assoc, presId, &req, NULL /* imageFileName */, dicom->getDataset(), | 313 assoc, presId, &req, NULL /* imageFileName */, dicom->getDataset(), |
314 GetSubOpProgressCallback, this /* callbackData */, | 314 ProgressCallback, NULL /* callbackData */, |
315 (timeout_ > 0 ? DIMSE_NONBLOCKING : DIMSE_BLOCKING), timeout_, | 315 (timeout_ > 0 ? DIMSE_NONBLOCKING : DIMSE_BLOCKING), timeout_, |
316 &rsp, &stDetailTmp, &cancelParameters); | 316 &rsp, &stDetailTmp, &cancelParameters); |
317 stDetail.reset(stDetailTmp); | 317 stDetail.reset(stDetailTmp); |
318 } | 318 } |
319 else | 319 else |
330 // Transcoding has succeeded | 330 // Transcoding has succeeded |
331 DcmDataset *stDetailTmp = NULL; | 331 DcmDataset *stDetailTmp = NULL; |
332 cond = DIMSE_storeUser( | 332 cond = DIMSE_storeUser( |
333 assoc, presId, &req, NULL /* imageFileName */, | 333 assoc, presId, &req, NULL /* imageFileName */, |
334 transcoded.GetParsed().getDataset(), | 334 transcoded.GetParsed().getDataset(), |
335 GetSubOpProgressCallback, this /* callbackData */, | 335 ProgressCallback, NULL /* callbackData */, |
336 (timeout_ > 0 ? DIMSE_NONBLOCKING : DIMSE_BLOCKING), timeout_, | 336 (timeout_ > 0 ? DIMSE_NONBLOCKING : DIMSE_BLOCKING), timeout_, |
337 &rsp, &stDetailTmp, &cancelParameters); | 337 &rsp, &stDetailTmp, &cancelParameters); |
338 stDetail.reset(stDetailTmp); | 338 stDetail.reset(stDetailTmp); |
339 } | 339 } |
340 else | 340 else |
351 | 351 |
352 bool isContinue; | 352 bool isContinue; |
353 | 353 |
354 if (cond.good()) | 354 if (cond.good()) |
355 { | 355 { |
356 { | |
357 OFString str; | |
358 CLOG(TRACE, DICOM) << "Received Store Response following a C-GET:" << std::endl | |
359 << DIMSE_dumpMessage(str, rsp, DIMSE_INCOMING); | |
360 } | |
361 | |
356 if (cancelParameters.cancelEncountered) | 362 if (cancelParameters.cancelEncountered) |
357 { | 363 { |
358 LOG(INFO) << "C-GET SCP: Received C-Cancel RQ"; | 364 LOG(INFO) << "C-GET SCP: Received C-Cancel RQ"; |
359 isContinue = false; | 365 isContinue = false; |
360 } | 366 } |