diff OrthancServer/OrthancRestApi/OrthancRestArchive.cpp @ 3181:6fd38327e777

Fix issue #130 (Orthanc failed to start when /tmp partition was full)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 31 Jan 2019 15:33:27 +0100
parents 5cf29046c159
children e44e0127e553
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestArchive.cpp	Wed Jan 30 17:50:51 2019 +0100
+++ b/OrthancServer/OrthancRestApi/OrthancRestArchive.cpp	Thu Jan 31 15:33:27 2019 +0100
@@ -37,6 +37,7 @@
 #include "../../Core/HttpServer/FilesystemHttpSender.h"
 #include "../../Core/OrthancException.h"
 #include "../../Core/SerializationToolbox.h"
+#include "../OrthancConfiguration.h"
 #include "../ServerContext.h"
 #include "../ServerJobs/ArchiveJob.h"
 
@@ -136,7 +137,13 @@
 
     if (synchronous)
     {
-      boost::shared_ptr<TemporaryFile> tmp(new TemporaryFile);
+      boost::shared_ptr<TemporaryFile> tmp;
+
+      {
+        OrthancConfiguration::ReaderLock lock;
+        tmp.reset(lock.GetConfiguration().CreateTemporaryFile());
+      }
+
       job->SetSynchronousTarget(tmp);
     
       Json::Value publicContent;