#include <CurlInterface.h>
Public Types | |
typedef std::vector< char > | Content |
Public Member Functions | |
CURLcode | getContent (const std::string &url, const std::string &user, Content &content) |
CURLcode | postBinaryMessage (const std::string &url, void *buf, size_t size, Content &content) |
~CurlInterface () | |
Static Public Member Functions | |
static boost::shared_ptr < CurlInterface > | getInterface () |
Private Member Functions | |
CurlInterface () | |
CURLcode | do_curl (CURL *, const std::string &url, Content &content) |
Static Private Member Functions | |
static unsigned long | sslIdFunction () |
static void | sslLockingFunction (int mode, int n, const char *file, int line) |
static size_t | writeToString (char *data, size_t size, size_t nmemb, Content *buffer) |
Static Private Attributes | |
static boost::shared_ptr < CurlInterface > | interface_ |
static pthread_mutex_t * | mutexes_ = 0 |
Helper class to interact with curl
Definition at line 26 of file CurlInterface.h.
typedef std::vector<char> stor::CurlInterface::Content |
Definition at line 31 of file CurlInterface.h.
CurlInterface::~CurlInterface | ( | ) |
|
private |
Definition at line 13 of file CurlInterface.cc.
References edm::hlt::Exception, i, mutexes_, sslIdFunction(), and sslLockingFunction().
Referenced by getInterface().
|
private |
Definition at line 98 of file CurlInterface.cc.
References i, runEdmFileComparison::returnCode, and writeToString().
CURLcode CurlInterface::getContent | ( | const std::string & | url, |
const std::string & | user, | ||
Content & | content | ||
) |
Get webpage content from specified URL using the user/password specified. If the return value is CURLE_OK, the webpage could be fetched and the content is in the content string. Otherwise, the content string contains the error message.
Definition at line 57 of file CurlInterface.cc.
|
static |
Return a shared pointer to the singleton
Definition at line 45 of file CurlInterface.cc.
References CurlInterface(), and interface_.
Referenced by stor::ResourceMonitorCollection::checkSataDisks(), and stor::EventServerProxy< RegInfo >::getInitMsgFromEventServer().
CURLcode CurlInterface::postBinaryMessage | ( | const std::string & | url, |
void * | buf, | ||
size_t | size, | ||
Content & | content | ||
) |
Post message a message at the given location. If the return value is CURLE_OK, the post succeeded and the reply is in the content string. Otherwise, the content string contains the error message.
Definition at line 73 of file CurlInterface.cc.
References NULL, and ntuplemaker::status.
|
staticprivate |
Definition at line 149 of file CurlInterface.cc.
Referenced by CurlInterface().
|
staticprivate |
Definition at line 140 of file CurlInterface.cc.
References mutexes_.
Referenced by CurlInterface().
|
staticprivate |
|
staticprivate |
Definition at line 67 of file CurlInterface.h.
Referenced by getInterface().
|
staticprivate |
Definition at line 68 of file CurlInterface.h.
Referenced by CurlInterface(), sslLockingFunction(), and ~CurlInterface().