Remove curl initialization code.
authorcantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Wed, 29 Aug 2007 18:40:29 +0000 (18:40 +0000)
committercantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Wed, 29 Aug 2007 18:40:29 +0000 (18:40 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@377 de75baf8-a10c-0410-a50a-987c0e22f00f

xmltooling/util/CurlNetAccessor.cpp
xmltooling/util/CurlNetAccessor.hpp

index 6224f20..4e255b5 100644 (file)
@@ -40,47 +40,13 @@ const XMLCh CurlNetAccessor::fgMyName[] =
 
 CurlNetAccessor::CurlNetAccessor()
 {
-       initCurl();
 }
 
 
 CurlNetAccessor::~CurlNetAccessor()
 {
-       cleanupCurl();
 }
 
-
-//
-// Global once-only init and cleanup of curl
-//
-// The init count used here is not thread protected; we assume
-// that creation of the CurlNetAccessor will be serialized by
-// the application. If the application is also using curl, then
-// care must be taken that curl is initialized only once, by some
-// other means, or by overloading these methods.
-//
-int CurlNetAccessor::fgCurlInitCount = 0;
-
-void
-CurlNetAccessor::initCurl()
-{
-       if (fgCurlInitCount++ == 0)
-               curl_global_init(       0
-                                                 | CURL_GLOBAL_ALL                     // Initialize all curl modules
-                                       //        | CURL_GLOBAL_WIN32           // Initialize Windows sockets first
-                                       //        | CURL_GLOBAL_SSL                     // Initialize SSL first
-                                                 );
-}
-
-
-void
-CurlNetAccessor::cleanupCurl()
-{
-       if (fgCurlInitCount > 0 && --fgCurlInitCount == 0)
-               curl_global_cleanup();
-}
-
-
 BinInputStream*
 CurlNetAccessor::makeNew(const XMLURL&  urlSource, const XMLNetHTTPInfo* httpInfo/*=0*/)
 {
@@ -90,4 +56,3 @@ CurlNetAccessor::makeNew(const XMLURL&  urlSource, const XMLNetHTTPInfo* httpInf
                new (urlSource.getMemoryManager()) CurlURLInputStream(urlSource, httpInfo);
        return retStrm;            
 }
-
index 4aabcea..a032d57 100644 (file)
@@ -46,11 +46,7 @@ public :
     virtual BinInputStream* makeNew(const XMLURL&  urlSource, const XMLNetHTTPInfo* httpInfo=0);
     virtual const XMLCh* getId() const;
 
-    virtual void initCurl(void);
-    virtual void cleanupCurl(void);
-
 private :
-       static int fgCurlInitCount;
     static const XMLCh fgMyName[];
 
     CurlNetAccessor(const CurlNetAccessor&);