# HG changeset patch # User Sebastien Jodogne # Date 1548754440 -3600 # Node ID 096f4a29f2239a526ef9b6a0f3dc5f4b604a019e # Parent b626fefdb50781271f2036c5f716d1c2a4af987d# Parent 81cd9a4f30186e6a08beac91e8a8d32837098523 merge diff -r b626fefdb507 -r 096f4a29f223 Core/HttpServer/HttpOutput.cpp --- a/Core/HttpServer/HttpOutput.cpp Tue Jan 29 10:32:21 2019 +0100 +++ b/Core/HttpServer/HttpOutput.cpp Tue Jan 29 10:34:00 2019 +0100 @@ -177,6 +177,10 @@ { s += "Connection: keep-alive\r\n"; } + else + { + s += "Connection: close\r\n"; + } for (std::list::const_iterator it = headers_.begin(); it != headers_.end(); ++it) @@ -435,6 +439,10 @@ header += "Connection: close\r\n"; #endif } + else + { + header += "Connection: close\r\n"; + } // Possibly add the cookies for (std::list::const_iterator diff -r b626fefdb507 -r 096f4a29f223 NEWS --- a/NEWS Tue Jan 29 10:32:21 2019 +0100 +++ b/NEWS Tue Jan 29 10:34:00 2019 +0100 @@ -1,6 +1,10 @@ Pending changes in the mainline =============================== + +Version 1.5.3 (2019-01-25) +========================== + General ------- @@ -11,6 +15,7 @@ * Don't return tags whose group is below 0x0008 in C-FIND SCP answers * Fix compatibility with DICOMweb plugin (allow multipart answers over HTTP Keep-Alive) +* Fix issue #73 (/modalities/{modalityId}/store raises 500 errors instead of 404) * Fix issue #90 (C-Find shall match missing tags to null/empty string) * Fix issue #119 (/patients/.../archive returns a 500 when JobsHistorySize is 0) * Fix issue #128 (Asynchronous C-MOVE: invalid number of remaining sub-operations) diff -r b626fefdb507 -r 096f4a29f223 OrthancExplorer/explorer.html --- a/OrthancExplorer/explorer.html Tue Jan 29 10:32:21 2019 +0100 +++ b/OrthancExplorer/explorer.html Tue Jan 29 10:34:00 2019 +0100 @@ -50,6 +50,14 @@
+
+

+ + Orthanc + +

+
+
diff -r b626fefdb507 -r 096f4a29f223 OrthancExplorer/orthanc-logo.png Binary file OrthancExplorer/orthanc-logo.png has changed diff -r b626fefdb507 -r 096f4a29f223 OrthancServer/OrthancRestApi/OrthancRestModalities.cpp --- a/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp Tue Jan 29 10:32:21 2019 +0100 +++ b/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp Tue Jan 29 10:34:00 2019 +0100 @@ -813,7 +813,7 @@ * DICOM C-Store SCU ***************************************************************************/ - static bool GetInstancesToExport(Json::Value& otherArguments, + static void GetInstancesToExport(Json::Value& otherArguments, SetOfInstancesJob& job, const std::string& remote, RestApiPostCall& call) @@ -834,7 +834,7 @@ else if (!call.ParseJsonRequest(request)) { // Bad JSON request - return false; + throw OrthancException(ErrorCode_BadFileFormat, "Must provide a JSON value"); } if (request.isString()) @@ -843,6 +843,11 @@ request = Json::arrayValue; request.append(item); } + else if (!request.isArray() && + !request.isObject()) + { + throw OrthancException(ErrorCode_BadFileFormat, "Must provide a JSON object, or a JSON array of strings"); + } const Json::Value* resources; if (request.isArray()) @@ -854,13 +859,15 @@ if (request.type() != Json::objectValue || !request.isMember(KEY_RESOURCES)) { - return false; + throw OrthancException(ErrorCode_BadFileFormat, + "Missing field in JSON: \"" + std::string(KEY_RESOURCES) + "\""); } resources = &request[KEY_RESOURCES]; if (!resources->isArray()) { - return false; + throw OrthancException(ErrorCode_BadFileFormat, + "JSON field \"" + std::string(KEY_RESOURCES) + "\" must contain an array"); } // Copy the remaining arguments @@ -882,24 +889,24 @@ { if (!(*resources) [i].isString()) { - return false; + throw OrthancException(ErrorCode_BadFileFormat, + "Resources to be exported must be specified as a JSON array of strings"); } std::string stripped = Toolbox::StripSpaces((*resources) [i].asString()); if (!Toolbox::IsSHA1(stripped)) { - return false; + throw OrthancException(ErrorCode_BadFileFormat, + "This string is not a valid Orthanc identifier: " + stripped); } + context.AddChildInstances(job, stripped); + if (logExportedResources) { context.GetIndex().LogExportedResource(stripped, remote); } - - context.AddChildInstances(job, stripped); } - - return true; } @@ -912,26 +919,25 @@ Json::Value request; std::auto_ptr job(new DicomModalityStoreJob(context)); - if (GetInstancesToExport(request, *job, remote, call)) - { - std::string localAet = Toolbox::GetJsonStringField - (request, "LocalAet", context.GetDefaultLocalApplicationEntityTitle()); - std::string moveOriginatorAET = Toolbox::GetJsonStringField - (request, "MoveOriginatorAet", context.GetDefaultLocalApplicationEntityTitle()); - int moveOriginatorID = Toolbox::GetJsonIntegerField - (request, "MoveOriginatorID", 0 /* By default, not a C-MOVE */); + GetInstancesToExport(request, *job, remote, call); + + std::string localAet = Toolbox::GetJsonStringField + (request, "LocalAet", context.GetDefaultLocalApplicationEntityTitle()); + std::string moveOriginatorAET = Toolbox::GetJsonStringField + (request, "MoveOriginatorAet", context.GetDefaultLocalApplicationEntityTitle()); + int moveOriginatorID = Toolbox::GetJsonIntegerField + (request, "MoveOriginatorID", 0 /* By default, not a C-MOVE */); - job->SetLocalAet(localAet); - job->SetRemoteModality(MyGetModalityUsingSymbolicName(remote)); + job->SetLocalAet(localAet); + job->SetRemoteModality(MyGetModalityUsingSymbolicName(remote)); - if (moveOriginatorID != 0) - { - job->SetMoveOriginator(moveOriginatorAET, moveOriginatorID); - } + if (moveOriginatorID != 0) + { + job->SetMoveOriginator(moveOriginatorAET, moveOriginatorID); + } - OrthancRestApi::GetApi(call).SubmitCommandsJob - (call, job.release(), true /* synchronous by default */, request); - } + OrthancRestApi::GetApi(call).SubmitCommandsJob + (call, job.release(), true /* synchronous by default */, request); } @@ -1059,22 +1065,21 @@ Json::Value request; std::auto_ptr job(new OrthancPeerStoreJob(context)); - if (GetInstancesToExport(request, *job, remote, call)) - { - OrthancConfiguration::ReaderLock lock; + GetInstancesToExport(request, *job, remote, call); + + OrthancConfiguration::ReaderLock lock; - WebServiceParameters peer; - if (lock.GetConfiguration().LookupOrthancPeer(peer, remote)) - { - job->SetPeer(peer); - OrthancRestApi::GetApi(call).SubmitCommandsJob - (call, job.release(), true /* synchronous by default */, request); - } - else - { - throw OrthancException(ErrorCode_UnknownResource, - "No peer with symbolic name: " + remote); - } + WebServiceParameters peer; + if (lock.GetConfiguration().LookupOrthancPeer(peer, remote)) + { + job->SetPeer(peer); + OrthancRestApi::GetApi(call).SubmitCommandsJob + (call, job.release(), true /* synchronous by default */, request); + } + else + { + throw OrthancException(ErrorCode_UnknownResource, + "No peer with symbolic name: " + remote); } } diff -r b626fefdb507 -r 096f4a29f223 Resources/CMake/OrthancFrameworkParameters.cmake diff -r b626fefdb507 -r 096f4a29f223 Resources/DownloadOrthancFramework.cmake --- a/Resources/DownloadOrthancFramework.cmake Tue Jan 29 10:32:21 2019 +0100 +++ b/Resources/DownloadOrthancFramework.cmake Tue Jan 29 10:34:00 2019 +0100 @@ -97,6 +97,8 @@ set(ORTHANC_FRAMEWORK_MD5 "099671538865e5da96208b37494d6718") elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.2") set(ORTHANC_FRAMEWORK_MD5 "8867050f3e9a1ce6157c1ea7a9433b1b") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.3") + set(ORTHANC_FRAMEWORK_MD5 "bf2f5ed1adb8b0fc5f10d278e68e1dfe") endif() endif() endif()