diff OrthancFramework/Sources/Lua/LuaContext.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 d9473bd5ed43
children 7053502fbf97
line wrap: on
line diff
--- a/OrthancFramework/Sources/Lua/LuaContext.cpp	Fri Apr 30 10:09:50 2021 +0200
+++ b/OrthancFramework/Sources/Lua/LuaContext.cpp	Tue May 04 10:57:42 2021 +0200
@@ -239,7 +239,7 @@
     const char* url = lua_tostring(state, 1);
     that.httpClient_.SetMethod(HttpMethod_Get);
     that.httpClient_.SetUrl(url);
-    that.httpClient_.GetBody().clear();
+    that.httpClient_.ClearBody();
     that.SetHttpHeaders(2);
 
     // Do the HTTP GET request
@@ -284,16 +284,16 @@
 
       if (bodySize == 0)
       {
-        that.httpClient_.GetBody().clear();
+        that.httpClient_.ClearBody();
       }
       else
       {
-        that.httpClient_.GetBody().assign(bodyData, bodySize);
+        that.httpClient_.AssignBody(bodyData, bodySize);
       }
     }
     else
     {
-      that.httpClient_.GetBody().clear();
+      that.httpClient_.ClearBody();
     }
 
     // Do the HTTP POST/PUT request
@@ -342,7 +342,7 @@
     const char* url = lua_tostring(state, 1);
     that.httpClient_.SetMethod(HttpMethod_Delete);
     that.httpClient_.SetUrl(url);
-    that.httpClient_.GetBody().clear();
+    that.httpClient_.ClearBody();
     that.SetHttpHeaders(2);
 
     // Do the HTTP DELETE request