diff OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp @ 4281:d2f79a475b51

debug log for DCMTK SCU
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Nov 2020 13:48:42 +0100
parents bf7b9edf6b81
children 756126cd2219
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp	Wed Nov 04 07:56:22 2020 +0100
+++ b/OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp	Wed Nov 04 13:48:42 2020 +0100
@@ -34,6 +34,20 @@
 
 namespace Orthanc
 {
+  static void ProgressCallback(void * /*callbackData*/,
+                               T_DIMSE_StoreProgress *progress,
+                               T_DIMSE_C_StoreRQ * req)
+  {
+    if (req != NULL &&
+        progress->state == DIMSE_StoreBegin)
+    {
+      OFString str;
+      CLOG(TRACE, DICOM) << "Sending Store Request:" << std::endl
+                         << DIMSE_dumpMessage(str, *req, DIMSE_OUTGOING);
+    }
+  }
+
+
   bool DicomStoreUserConnection::ProposeStorageClass(const std::string& sopClassUid,
                                                      const std::set<DicomTransferSyntax>& syntaxes)
   {
@@ -357,7 +371,7 @@
     DcmDataset* statusDetail = NULL;
     DicomAssociation::CheckCondition(
       DIMSE_storeUser(&association_->GetDcmtkAssociation(), presID, &request,
-                      NULL, dicom.getDataset(), /*progressCallback*/ NULL, NULL,
+                      NULL, dicom.getDataset(), ProgressCallback, NULL,
                       /*opt_blockMode*/ (GetParameters().HasTimeout() ? DIMSE_NONBLOCKING : DIMSE_BLOCKING),
                       /*opt_dimse_timeout*/ GetParameters().GetTimeout(),
                       &response, &statusDetail, NULL),
@@ -367,6 +381,12 @@
     {
       delete statusDetail;
     }
+
+    {
+      OFString str;
+      CLOG(TRACE, DICOM) << "Received Store Response:" << std::endl
+                         << DIMSE_dumpMessage(str, response, DIMSE_INCOMING, NULL, presID);
+    }
     
     /**
      * New in Orthanc 1.6.0: Deal with failures during C-STORE.