19 response = curlResponse;
22 curl_easy_setopt(
m_curl, CURLOPT_HEADERDATA, (
void*)response.
get());
24 curl_easy_setopt(
m_curl, CURLOPT_WRITEDATA, (
void*)response.
get());
25 curl_easy_setopt(
m_curl, CURLOPT_HEADER, 0);
26 curl_easy_setopt(
m_curl, CURLOPT_NOBODY, 0);
32 curl_easy_setopt(
m_curl, CURLOPT_RANGE, range.
c_str());
41 curl_easy_setopt(
m_curl, CURLOPT_URL, urlString.c_str());
44 if(protocol ==
"https")
49 int rc = curl_easy_perform(
m_curl);
51 if(rc == CURLE_SSL_CONNECT_ERROR)
54 curl_easy_setopt(
m_curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_SSLv3);
55 rc = curl_easy_perform(
m_curl);
57 bool result = (rc < 1);
81 if(protocol ==
"http")
85 else if(protocol ==
"https")
87 curl_version_info_data * vinfo = curl_version_info( CURLVERSION_NOW );
88 if( vinfo->features & CURL_VERSION_SSL )
123 double contentLength=-1;
131 curl_easy_setopt(
m_curl, CURLOPT_HEADERDATA, (
void*)response.
get());
133 curl_easy_setopt(
m_curl, CURLOPT_WRITEDATA, (
void*)response.
get());
134 curl_easy_setopt(
m_curl, CURLOPT_HEADER, 0);
135 curl_easy_setopt(
m_curl, CURLOPT_NOBODY, 1);
136 curl_easy_setopt(
m_curl, CURLOPT_RANGE,
"");
139 struct curl_slist *headers=0;
141 ossimKeywordlist::KeywordMap::const_iterator iter = headerMap.begin();
142 while(iter != headerMap.end())
145 headers = curl_slist_append(headers, ((*iter).first +
":"+(*iter).second).c_str());
148 curl_easy_setopt(
m_curl, CURLOPT_URL, urlString.
c_str());
149 if(protocol ==
"https")
153 int rc = curl_easy_perform(
m_curl);
156 if(rc == CURLE_SSL_CONNECT_ERROR)
159 curl_easy_setopt(
m_curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_SSLv3);
160 rc = curl_easy_perform(
m_curl);
162 bool result = (rc < 1);
166 rc = curl_easy_getinfo(
m_curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &contentLength);
182 curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_DEFAULT);
186 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
190 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
ossimString substitute(const ossimString &searchKey, const ossimString &replacementValue, bool replaceAll=false) const
Substitutes searchKey string with replacementValue and returns a string.
const char * find(const char *key) const
virtual bool supportsProtocol(const ossimString &protocol) const
ossim_int64 getContentLength() const
static int curlWriteResponseHeader(void *buffer, size_t size, size_t nmemb, void *stream)
ossimKeywordlist m_headerOptions
virtual ossimRefPtr< ossimWebResponse > getResponse()
std::iostream & headerStream()
void setDefaultSSL(CURL *curl) const
ossimString toString() const
std::map< std::string, std::string > KeywordMap
HttpMethodType m_methodType
const ossimString & getProtocol() const
static ossimFilename m_cacert
static ossimFilename m_clientKey
const ossimUrl & getUrl() const
std::iostream & bodyStream()
const ossimKeywordlist::KeywordMap & getMap() const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
static ossimString m_clientCertType
static ossimString m_clientKeyPassword
static int curlWriteResponseBody(void *buffer, size_t size, size_t nmemb, void *stream)
void convertHeaderStreamToKeywordlist()
This will parse out the response code from the status line and initialize the header variables into a...
static ossimFilename m_clientCert