diff Plugins/Samples/Common/OrthancPluginCppWrapper.h @ 3443:0371b65d5f76

OrthancPlugins::HttpClient::SetChunkedTransfersAllowed()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 24 Jun 2019 16:55:28 +0200
parents d97ef941d521
children f93a9c6c00c5
line wrap: on
line diff
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Mon Jun 24 16:06:47 2019 +0200
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Mon Jun 24 16:55:28 2019 +0200
@@ -845,7 +845,8 @@
     std::string              certificateKeyPassword_;
     bool                     pkcs11_;
     std::string              fullBody_;
-    IRequestBody*            chunkedBody_;    
+    IRequestBody*            chunkedBody_;
+    bool                     allowChunkedTransfers_;
 
 #if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT == 1
     void ExecuteWithStream(uint16_t& httpStatus,  // out
@@ -923,6 +924,18 @@
 
     void SetBody(IRequestBody& body);
 
+    // This function can be used to disable chunked transfers if the
+    // remote server is Orthanc with a version <= 1.5.6.
+    void SetChunkedTransfersAllowed(bool allow)
+    {
+      allowChunkedTransfers_ = allow;
+    }
+
+    bool IsChunkedTransfersAllowed() const
+    {
+      return allowChunkedTransfers_;
+    }
+
     void Execute(IAnswer& answer);
 
     void Execute(HttpHeaders& answerHeaders /* out */,