comparison OrthancServer/Sources/main.cpp @ 4819:70d2a97ca8cb openssl-3.x

integration mainline->openssl-3.x
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 25 Nov 2021 13:12:32 +0100
parents 61da49321754 7afbb54bd028
children 2e71a08eea15
comparison
equal deleted inserted replaced
4785:61da49321754 4819:70d2a97ca8cb
70 context_(context) 70 context_(context)
71 { 71 {
72 } 72 }
73 73
74 74
75 virtual void Handle(DcmDataset& dicom, 75 virtual uint16_t Handle(DcmDataset& dicom,
76 const std::string& remoteIp, 76 const std::string& remoteIp,
77 const std::string& remoteAet, 77 const std::string& remoteAet,
78 const std::string& calledAet) ORTHANC_OVERRIDE 78 const std::string& calledAet) ORTHANC_OVERRIDE
79 { 79 {
80 std::unique_ptr<DicomInstanceToStore> toStore(DicomInstanceToStore::CreateFromDcmDataset(dicom)); 80 std::unique_ptr<DicomInstanceToStore> toStore(DicomInstanceToStore::CreateFromDcmDataset(dicom));
81 81
82 if (toStore->GetBufferSize() > 0) 82 if (toStore->GetBufferSize() > 0)
83 { 83 {
84 toStore->SetOrigin(DicomInstanceOrigin::FromDicomProtocol 84 toStore->SetOrigin(DicomInstanceOrigin::FromDicomProtocol
85 (remoteIp.c_str(), remoteAet.c_str(), calledAet.c_str())); 85 (remoteIp.c_str(), remoteAet.c_str(), calledAet.c_str()));
86 86
87 std::string id; 87 std::string id;
88 context_.Store(id, *toStore, StoreInstanceMode_Default); 88 ServerContext::StoreResult result = context_.Store(id, *toStore, StoreInstanceMode_Default);
89 } 89 return result.GetCStoreStatusCode();
90 }
91
92 return STATUS_STORE_Error_CannotUnderstand;
90 } 93 }
91 }; 94 };
92 95
93 96
94 97
1196 { 1199 {
1197 OrthancConfiguration::ReaderLock lock; 1200 OrthancConfiguration::ReaderLock lock;
1198 dicomServer.SetCalledApplicationEntityTitleCheck(lock.GetConfiguration().GetBooleanParameter("DicomCheckCalledAet", false)); 1201 dicomServer.SetCalledApplicationEntityTitleCheck(lock.GetConfiguration().GetBooleanParameter("DicomCheckCalledAet", false));
1199 dicomServer.SetAssociationTimeout(lock.GetConfiguration().GetUnsignedIntegerParameter("DicomScpTimeout", 30)); 1202 dicomServer.SetAssociationTimeout(lock.GetConfiguration().GetUnsignedIntegerParameter("DicomScpTimeout", 30));
1200 dicomServer.SetPortNumber(lock.GetConfiguration().GetUnsignedIntegerParameter("DicomPort", 4242)); 1203 dicomServer.SetPortNumber(lock.GetConfiguration().GetUnsignedIntegerParameter("DicomPort", 4242));
1204 dicomServer.SetThreadsCount(lock.GetConfiguration().GetUnsignedIntegerParameter("DicomThreadsCount", 4));
1201 dicomServer.SetApplicationEntityTitle(lock.GetConfiguration().GetOrthancAET()); 1205 dicomServer.SetApplicationEntityTitle(lock.GetConfiguration().GetOrthancAET());
1202 1206
1203 // Configuration of DICOM TLS for Orthanc SCP (since Orthanc 1.9.0) 1207 // Configuration of DICOM TLS for Orthanc SCP (since Orthanc 1.9.0)
1204 dicomServer.SetDicomTlsEnabled(lock.GetConfiguration().GetBooleanParameter(KEY_DICOM_TLS_ENABLED, false)); 1208 dicomServer.SetDicomTlsEnabled(lock.GetConfiguration().GetBooleanParameter(KEY_DICOM_TLS_ENABLED, false));
1205 if (dicomServer.IsDicomTlsEnabled()) 1209 if (dicomServer.IsDicomTlsEnabled())
1506 context.GetIndex().SetMaximumStorageSize(size * 1024 * 1024); 1510 context.GetIndex().SetMaximumStorageSize(size * 1024 * 1024);
1507 } 1511 }
1508 catch (...) 1512 catch (...)
1509 { 1513 {
1510 context.GetIndex().SetMaximumStorageSize(0); 1514 context.GetIndex().SetMaximumStorageSize(0);
1515 }
1516
1517 try
1518 {
1519 uint64_t size = lock.GetConfiguration().GetUnsignedIntegerParameter("MaximumStorageCacheSize", 128);
1520 context.SetMaximumStorageCacheSize(size * 1024 * 1024);
1521 }
1522 catch (...)
1523 {
1524 context.SetMaximumStorageCacheSize(128);
1511 } 1525 }
1512 } 1526 }
1513 1527
1514 { 1528 {
1515 ServerContextConfigurator configurator(context, plugins); // This calls "OrthancConfiguration::SetServerIndex()" 1529 ServerContextConfigurator configurator(context, plugins); // This calls "OrthancConfiguration::SetServerIndex()"