diff Core/HttpServer/HttpOutput.h @ 3528:f6fe095f7130

don't open a multipart stream if plugin only sends one part
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 26 Sep 2019 13:40:49 +0200
parents 4e43e67f8ecf
children 94f4a18a79cc
line wrap: on
line diff
--- a/Core/HttpServer/HttpOutput.h	Thu Sep 26 10:50:58 2019 +0200
+++ b/Core/HttpServer/HttpOutput.h	Thu Sep 26 13:40:49 2019 +0200
@@ -41,6 +41,7 @@
 #include <string>
 #include <stdint.h>
 #include <map>
+#include <vector>
 
 namespace Orthanc
 {
@@ -113,6 +114,8 @@
       {
         return state_;
       }
+
+      void CheckHeadersCompatibilityWithMultipart() const;
     };
 
     StateMachine stateMachine_;
@@ -229,5 +232,19 @@
     }
 
     void Answer(IHttpStreamAnswer& stream);
+
+    /**
+     * This method is a replacement to the combination
+     * "StartMultipart()" + "SendMultipartItem()". It generates the
+     * same answer, but it gives a chance to compress the body if
+     * "Accept-Encoding: gzip" is provided by the client, which is not
+     * possible in chunked transfers.
+     **/
+    void AnswerMultipartWithoutChunkedTransfer(
+      const std::string& subType,
+      const std::string& contentType,
+      const std::vector<const void*>& parts,
+      const std::vector<size_t>& sizes,
+      const std::vector<const std::map<std::string, std::string>*>& headers);
   };
 }