From: cantor Date: Thu, 2 Aug 2007 20:20:28 +0000 (+0000) Subject: No way that void* stuff will work. X-Git-Tag: 1.4.1~458 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fxmltooling.git;a=commitdiff_plain;h=a476811ab71e3f3592e0e8e455ad034434ff18f5 No way that void* stuff will work. git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@367 de75baf8-a10c-0410-a50a-987c0e22f00f --- diff --git a/xmltooling/soap/SOAPTransport.h b/xmltooling/soap/SOAPTransport.h index 3f0644b..dabea8d 100644 --- a/xmltooling/soap/SOAPTransport.h +++ b/xmltooling/soap/SOAPTransport.h @@ -137,11 +137,11 @@ namespace xmltooling { * Without the proper knowledge and inputs, crashes may result. * * @param provider name of the SOAPTransport class the caller believes is in use - * @param option implementation-specific data containing the option to set - * @param value implementation- and option-specific data to use + * @param option implementation-specific string containing the option to set + * @param value implementation- and option-specific string to use * @return true iff the transport supports the option and value supplied */ - virtual bool setProviderOption(const char* provider, void* option, void* value) { + virtual bool setProviderOption(const char* provider, const char* option, const char* value) { return false; } diff --git a/xmltooling/soap/impl/CURLSOAPTransport.cpp b/xmltooling/soap/impl/CURLSOAPTransport.cpp index 319b16f..a1acf81 100644 --- a/xmltooling/soap/impl/CURLSOAPTransport.cpp +++ b/xmltooling/soap/impl/CURLSOAPTransport.cpp @@ -146,17 +146,17 @@ namespace xmltooling { return true; } - bool setProviderOption(const char* provider, void* option, void* value) { + bool setProviderOption(const char* provider, const char* option, const char* value) { if (!provider || strcmp(provider, "CURL")) return false; // For libcurl, the option is an enum and the value type depends on the option. - CURLoption opt = static_cast(reinterpret_cast(option)); + CURLoption opt = static_cast(strtol(option, NULL, 10)); if (opt < CURLOPTTYPE_OBJECTPOINT) - return (curl_easy_setopt(m_handle, opt, reinterpret_cast(value))==CURLE_OK); + return (curl_easy_setopt(m_handle, opt, strtol(value, NULL, 10)) == CURLE_OK); else if (opt < CURLOPTTYPE_OFF_T) - return (curl_easy_setopt(m_handle, opt, value)==CURLE_OK); - else if (sizeof(void*) == sizeof(curl_off_t)) - return (curl_easy_setopt(m_handle, opt, reinterpret_cast(value))==CURLE_OK); + return (curl_easy_setopt(m_handle, opt, value) == CURLE_OK); + else if (sizeof(curl_off_t) == sizeof(long)) + return (curl_easy_setopt(m_handle, opt, strtol(value, NULL, 10)) == CURLE_OK); return false; }