diff OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp @ 4650:9804d6490872

Reduced memory consumption of HTTP/REST plugins calls on POST/PUT if chunked transfer is disabled
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 May 2021 10:57:42 +0200
parents f8660649ae96
children 569d9ef165b1
line wrap: on
line diff
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp	Fri Apr 30 10:09:50 2021 +0200
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp	Tue May 04 10:57:42 2021 +0200
@@ -1862,7 +1862,7 @@
     HttpClient client(info, "instances");
     client.SetMethod(HttpMethod_Post);
     client.AddHeader("Expect", "");
-    client.GetBody().assign(reinterpret_cast<const char*>(call.GetBodyData()), call.GetBodySize());
+    client.SetExternalBody(call.GetBodyData(), call.GetBodySize());
 
     Json::Value answer;
     if (client.Apply(answer))