changeset 457:997282a61ff8

cleaner names
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 Jul 2013 16:00:13 +0200
parents 511efa5c84dd
children 84966299c8f8
files OrthancCppClient/HttpClient.cpp OrthancCppClient/HttpClient.h OrthancServer/OrthancInitialization.cpp
diffstat 3 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancCppClient/HttpClient.cpp	Thu Jul 04 15:53:46 2013 +0200
+++ b/OrthancCppClient/HttpClient.cpp	Thu Jul 04 16:00:13 2013 +0200
@@ -210,4 +210,16 @@
     std::string s = std::string(username) + ":" + std::string(password);
     CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_USERPWD, s.c_str()));
   }
+
+
+  
+  void HttpClient::GlobalInitialize()
+  {
+    CheckCode(curl_global_init(CURL_GLOBAL_DEFAULT));
+  }
+  
+  void HttpClient::GlobalFinalize()
+  {
+    curl_global_cleanup();
+  }
 }
--- a/OrthancCppClient/HttpClient.h	Thu Jul 04 15:53:46 2013 +0200
+++ b/OrthancCppClient/HttpClient.h	Thu Jul 04 16:00:13 2013 +0200
@@ -111,5 +111,9 @@
 
     void SetPassword(const char* username,
                      const char* password);
+
+    static void GlobalInitialize();
+  
+    static void GlobalFinalize();
   };
 }
--- a/OrthancServer/OrthancInitialization.cpp	Thu Jul 04 15:53:46 2013 +0200
+++ b/OrthancServer/OrthancInitialization.cpp	Thu Jul 04 16:00:13 2013 +0200
@@ -32,6 +32,7 @@
 
 #include "OrthancInitialization.h"
 
+#include "../OrthancCppClient/HttpClient.h"
 #include "../Core/OrthancException.h"
 #include "../Core/Toolbox.h"
 #include "ServerEnumerations.h"
@@ -161,7 +162,7 @@
     defaultDirectory_ = boost::filesystem::current_path();
     ReadGlobalConfiguration(configurationFile);
 
-    curl_global_init(CURL_GLOBAL_ALL);
+    HttpClient::GlobalInitialize();
 
     RegisterUserMetadata();
   }
@@ -171,7 +172,7 @@
   void OrthancFinalize()
   {
     boost::mutex::scoped_lock lock(globalMutex_);
-    curl_global_cleanup();
+    HttpClient::GlobalFinalize();
     configuration_.reset(NULL);
   }