diff OrthancServer/OrthancRestApi/OrthancRestApi.cpp @ 1446:8dc80ba768aa

refactoring: IHttpHandler does not use std::string to hold the request body
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 01 Jul 2015 13:16:12 +0200
parents 02f5a3f5c0a0
children f967bdf8534e
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestApi.cpp	Wed Jul 01 12:30:19 2015 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestApi.cpp	Wed Jul 01 13:16:12 2015 +0200
@@ -73,13 +73,15 @@
   {
     ServerContext& context = OrthancRestApi::GetContext(call);
 
-    const std::string& postData = call.GetPostBody();
-    if (postData.size() == 0)
+    if (call.GetBodySize() == 0)
     {
       return;
     }
 
-    LOG(INFO) << "Receiving a DICOM file of " << postData.size() << " bytes through HTTP";
+    LOG(INFO) << "Receiving a DICOM file of " << call.GetBodySize() << " bytes through HTTP";
+
+    // TODO Remove unneccessary memcpy
+    std::string postData(call.GetBodyData(), call.GetBodySize());
 
     DicomInstanceToStore toStore;
     toStore.SetBuffer(postData);