Changeset - 27e0dd7bb59b
[Not reviewed]
0 3 0
Jan Kaluza - 13 years ago 2012-08-20 12:42:10
hanzz.k@gmail.com
Send curl debug to stdcerr
3 files changed with 14 insertions and 4 deletions:
0 comments (0 inline, 0 general)
backends/twitter/libtwitcurl/twitcurl.cpp
Show inline comments
 
#include <memory.h>
 
#include "twitcurl.h"
 
#include "urlencode.h"
 
 
static int myDebugCallback(CURL *,
 
                    curl_infotype type,
 
                    char *data,
 
                    size_t size,
 
                    void *handle)
 
{
 
	std::cerr << std::string(data, size);
 
  return 0;
 
};
 
 
/*++
 
* @method: twitCurl::twitCurl
 
*
 
* @description: constructor
 
*
 
* @input: none
 
*
 
* @output: none
 
*
 
*--*/
 
twitCurl::twitCurl():
 
m_curlHandle( NULL ),
 
@@ -21,24 +31,26 @@ m_eApiFormatType( twitCurlTypes::eTwitCurlApiFormatXml ),
 
m_eProtocolType( twitCurlTypes::eTwitCurlProtocolHttp )
 
{
 
    /* Clear callback buffers */
 
    clearCurlCallbackBuffers();
 
 
    /* Initialize cURL */
 
    m_curlHandle = curl_easy_init();
 
    if( NULL == m_curlHandle )
 
    {
 
        std::string dummyStr;
 
        getLastCurlError( dummyStr );
 
    }
 
    curl_easy_setopt(m_curlHandle, CURLOPT_VERBOSE, 1);
 
	curl_easy_setopt(m_curlHandle, CURLOPT_DEBUGFUNCTION, myDebugCallback);
 
}
 
 
/*++
 
* @method: twitCurl::~twitCurl
 
*
 
* @description: destructor
 
*
 
* @input: none
 
*
 
* @output: none
 
*
 
*--*/
cmake_modules/opensslConfig.cmake
Show inline comments
 
@@ -227,26 +227,24 @@
 
      string(REGEX REPLACE "^0" "" OPENSSL_VERSION_PATCH "${OPENSSL_VERSION_PATCH}")
 
     
 
      set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_PATCH}")
 
    endif (OPENSSL_INCLUDE_DIR)
 
     
 
    include(FindPackageHandleStandardArgs)
 
     
 
    if (OPENSSL_VERSION)
 
      find_package_handle_standard_args(OpenSSL
 
        REQUIRED_VARS
 
          OPENSSL_LIBRARIES
 
          OPENSSL_INCLUDE_DIR
 
        VERSION_VAR
 
          OPENSSL_VERSION
 
        FAIL_MESSAGE
 
          "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
 
      )
 
    else (OPENSSL_VERSION)
 
      find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
 
        OPENSSL_LIBRARIES
 
        OPENSSL_INCLUDE_DIR
 
      )
 
    endif (OPENSSL_VERSION)
 
     
 
    MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
 
     
 
\ No newline at end of file
src/logging.cpp
Show inline comments
 
@@ -57,26 +57,26 @@ class intercept_stream : public std::streambuf{
 
public:
 
    intercept_stream(std::ostream& stream, char const* logger):
 
      _logger(log4cxx::Logger::getLogger(logger))
 
    {
 
		stream.rdbuf(this);
 
    }
 
    ~intercept_stream(){
 
    }
 
protected:
 
    virtual std::streamsize xsputn(const char *msg, std::streamsize count){
 

	
 
        //Output to log4cxx logger
 
        std::string s(msg,count);
 
		LOG4CXX_INFO(_logger, msg);
 
        std::string s(msg, count - 1); // remove last \n
 
		LOG4CXX_INFO(_logger, s);
 
        return count;
 
    }
 

	
 
	int overflow(int c)
 
	{
 
		return 0;
 
	}
 

	
 
	int sync()
 
	{
 
		return 0;
 
	}
0 comments (0 inline, 0 general)