comparison 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
comparison
equal deleted inserted replaced
3116:0fa7181ac4e5 3120:a323b75e5b08
80 80
81 81
82 #include "../PrecompiledHeaders.h" 82 #include "../PrecompiledHeaders.h"
83 #include "DicomUserConnection.h" 83 #include "DicomUserConnection.h"
84 84
85 #if !defined(DCMTK_VERSION_NUMBER)
86 # error The macro DCMTK_VERSION_NUMBER must be defined
87 #endif
88
85 #include "../DicomFormat/DicomArray.h" 89 #include "../DicomFormat/DicomArray.h"
86 #include "../Logging.h" 90 #include "../Logging.h"
87 #include "../OrthancException.h" 91 #include "../OrthancException.h"
88 #include "../DicomParsing/FromDcmtkBridge.h" 92 #include "../DicomParsing/FromDcmtkBridge.h"
89 #include "../DicomParsing/ToDcmtkBridge.h" 93 #include "../DicomParsing/ToDcmtkBridge.h"
328 } 332 }
329 333
330 // Figure out which SOP class and SOP instance is encapsulated in the file 334 // Figure out which SOP class and SOP instance is encapsulated in the file
331 DIC_UI sopClass; 335 DIC_UI sopClass;
332 DIC_UI sopInstance; 336 DIC_UI sopInstance;
337
338 #if DCMTK_VERSION_NUMBER >= 364
339 if (!DU_findSOPClassAndInstanceInDataSet(dcmff.getDataset(), sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance)))
340 #else
333 if (!DU_findSOPClassAndInstanceInDataSet(dcmff.getDataset(), sopClass, sopInstance)) 341 if (!DU_findSOPClassAndInstanceInDataSet(dcmff.getDataset(), sopClass, sopInstance))
342 #endif
334 { 343 {
335 throw OrthancException(ErrorCode_NoSopClassOrInstance); 344 throw OrthancException(ErrorCode_NoSopClassOrInstance);
336 } 345 }
337 346
338 // Figure out which of the accepted presentation contexts should be used 347 // Figure out which of the accepted presentation contexts should be used
570 request.Priority = DIMSE_PRIORITY_MEDIUM; 579 request.Priority = DIMSE_PRIORITY_MEDIUM;
571 request.DataSetType = DIMSE_DATASET_PRESENT; 580 request.DataSetType = DIMSE_DATASET_PRESENT;
572 581
573 T_DIMSE_C_FindRSP response; 582 T_DIMSE_C_FindRSP response;
574 DcmDataset* statusDetail = NULL; 583 DcmDataset* statusDetail = NULL;
584
585 #if DCMTK_VERSION_NUMBER >= 364
586 int responseCount;
587 #endif
588
575 OFCondition cond = DIMSE_findUser(association, presID, &request, dataset, 589 OFCondition cond = DIMSE_findUser(association, presID, &request, dataset,
590 #if DCMTK_VERSION_NUMBER >= 364
591 responseCount,
592 #endif
576 FindCallback, &payload, 593 FindCallback, &payload,
577 /*opt_blockMode*/ DIMSE_BLOCKING, 594 /*opt_blockMode*/ DIMSE_BLOCKING,
578 /*opt_dimse_timeout*/ dimseTimeout, 595 /*opt_dimse_timeout*/ dimseTimeout,
579 &response, &statusDetail); 596 &response, &statusDetail);
580 597