Convert from NULL macro to nullptr.
[shibboleth/cpp-xmltooling.git] / xmltooling / util / CurlURLInputStream.h
index a2be81e..a8b72ba 100644 (file)
@@ -46,7 +46,7 @@ namespace xmltooling {
          * @param url       the URL of the resource to fetch
          * @param cacheTag  optional pointer to string used for cache management
          */
-        CurlURLInputStream(const char* url, std::string* cacheTag=NULL);
+        CurlURLInputStream(const char* url, std::string* cacheTag=nullptr);
 
         /**
          * Constructor.
@@ -54,7 +54,7 @@ namespace xmltooling {
          * @param url       the URL of the resource to fetch
          * @param cacheTag  optional pointer to string used for cache management
          */
-        CurlURLInputStream(const XMLCh* url, std::string* cacheTag=NULL);
+        CurlURLInputStream(const XMLCh* url, std::string* cacheTag=nullptr);
 
         /**
          * Constructor taking a DOM element supporting the following content:
@@ -71,7 +71,7 @@ namespace xmltooling {
          * @param e         DOM to supply configuration
          * @param cacheTag  optional pointer to string used for cache management
          */
-        CurlURLInputStream(const xercesc::DOMElement* e, std::string* cacheTag=NULL);
+        CurlURLInputStream(const xercesc::DOMElement* e, std::string* cacheTag=nullptr);
 
         ~CurlURLInputStream();
 
@@ -92,6 +92,15 @@ namespace xmltooling {
 
         xsecsize_t readBytes(XMLByte* const toFill, const xsecsize_t maxToRead);
 
+        /**
+         * Access the OpenSSL context options in place for this object.
+         *
+         * @return bitmask suitable for use with SSL_CTX_set_options
+         */
+        int getOpenSSLOps() const {
+            return fOpenSSLOps;
+        }
+
     private :
         CurlURLInputStream(const CurlURLInputStream&);
         CurlURLInputStream& operator=(const CurlURLInputStream&);
@@ -100,13 +109,14 @@ namespace xmltooling {
         static size_t staticWriteCallback(char *buffer, size_t size, size_t nitems, void *outstream);
         size_t writeCallback(char *buffer, size_t size, size_t nitems);
 
-        void init(const xercesc::DOMElement* e=NULL);
+        void init(const xercesc::DOMElement* e=nullptr);
         bool readMore(int *runningHandles);
 
         logging::Category&  fLog;
         std::string*        fCacheTag;
         std::string         fURL;
         std::vector<std::string>    fSavedOptions;
+        int                 fOpenSSLOps;
 
         CURLM*              fMulti;
         CURL*               fEasy;
@@ -120,9 +130,10 @@ namespace xmltooling {
 
         // Overflow buffer for when curl writes more data to us
         // than we've asked for.
-        XMLByte             fBuffer[CURL_MAX_WRITE_SIZE];
+        XMLByte*            fBuffer;
         XMLByte*            fBufferHeadPtr;
         XMLByte*            fBufferTailPtr;
+        size_t              fBufferSize;
 
         XMLCh*              fContentType;
         long                fStatusCode;