changeset 4087:dcf4d83374a6 framework

integration mainline->framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 26 Jun 2020 09:47:51 +0200
parents 26efd0404d97 (current diff) 4cd94ed75a5b (diff)
children 160ec8417874
files OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake OrthancFramework/Sources/WebServiceParameters.cpp OrthancServer/Plugins/Engine/OrthancPlugins.cpp
diffstat 3 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Tue Jun 23 07:39:42 2020 +0200
+++ b/NEWS	Fri Jun 26 09:47:51 2020 +0200
@@ -10,6 +10,11 @@
 * New functions in the SDK:
   - new "changes": JobSubmitted, JobSuccess, JobFailure
 
+Maintenance
+-----------
+
+* Issue #182: Better handling of errors in plugins reading chunked HTTP body
+
 
 Version 1.7.1 (2020-05-27)
 ==========================
--- a/OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake	Tue Jun 23 07:39:42 2020 +0200
+++ b/OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake	Fri Jun 26 09:47:51 2020 +0200
@@ -104,6 +104,8 @@
 if (NOT ENABLE_DCMTK)
   add_definitions(
     -DORTHANC_ENABLE_DCMTK=0
+    -DORTHANC_ENABLE_DCMTK_JPEG=0
+    -DORTHANC_ENABLE_DCMTK_JPEG_LOSSLESS=0
     -DORTHANC_ENABLE_DCMTK_NETWORKING=0
     -DORTHANC_ENABLE_DCMTK_TRANSCODING=0
     )
--- a/OrthancServer/Plugins/Engine/OrthancPlugins.cpp	Tue Jun 23 07:39:42 2020 +0200
+++ b/OrthancServer/Plugins/Engine/OrthancPlugins.cpp	Fri Jun 26 09:47:51 2020 +0200
@@ -5131,15 +5131,15 @@
         OrthancPluginErrorCode errorCode = handler(
           &reader, matcher.GetFlatUri().c_str(), &converter.GetRequest());
     
-        if (reader == NULL)
+        if (errorCode != OrthancPluginErrorCode_Success)
+        {
+          throw OrthancException(static_cast<ErrorCode>(errorCode));
+        }
+        else if (reader == NULL)
         {
           // The plugin has not created a reader for chunked body
           return false;
         }
-        else if (errorCode != OrthancPluginErrorCode_Success)
-        {
-          throw OrthancException(static_cast<ErrorCode>(errorCode));
-        }
         else
         {
           target.reset(new HttpServerChunkedReader(reader, callback->GetParameters(), GetErrorDictionary()));