diff Core/DicomNetworking/DicomUserConnection.cpp @ 3120:a323b75e5b08 db-changes

Fix issue #125 (Mongoose: /instances/{id} returns 500 on invalid HTTP Method)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 14 Jan 2019 13:13:12 +0100
parents c8b75e207a82
children c4e1977e5ed7
line wrap: on
line diff
--- a/Core/DicomNetworking/DicomUserConnection.cpp	Sat Jan 12 11:08:53 2019 +0100
+++ b/Core/DicomNetworking/DicomUserConnection.cpp	Mon Jan 14 13:13:12 2019 +0100
@@ -82,6 +82,10 @@
 #include "../PrecompiledHeaders.h"
 #include "DicomUserConnection.h"
 
+#if !defined(DCMTK_VERSION_NUMBER)
+#  error The macro DCMTK_VERSION_NUMBER must be defined
+#endif
+
 #include "../DicomFormat/DicomArray.h"
 #include "../Logging.h"
 #include "../OrthancException.h"
@@ -330,7 +334,12 @@
     // Figure out which SOP class and SOP instance is encapsulated in the file
     DIC_UI sopClass;
     DIC_UI sopInstance;
+
+#if DCMTK_VERSION_NUMBER >= 364
+    if (!DU_findSOPClassAndInstanceInDataSet(dcmff.getDataset(), sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance)))
+#else
     if (!DU_findSOPClassAndInstanceInDataSet(dcmff.getDataset(), sopClass, sopInstance))
+#endif
     {
       throw OrthancException(ErrorCode_NoSopClassOrInstance);
     }
@@ -572,7 +581,15 @@
 
     T_DIMSE_C_FindRSP response;
     DcmDataset* statusDetail = NULL;
+
+#if DCMTK_VERSION_NUMBER >= 364
+    int responseCount;
+#endif
+
     OFCondition cond = DIMSE_findUser(association, presID, &request, dataset,
+#if DCMTK_VERSION_NUMBER >= 364
+				      responseCount,
+#endif
                                       FindCallback, &payload,
                                       /*opt_blockMode*/ DIMSE_BLOCKING, 
                                       /*opt_dimse_timeout*/ dimseTimeout,