#include <SquidNet.h>
Public Member Functions | |
bool | check () |
SquidNet (unsigned int, std::string const &) | |
virtual | ~SquidNet () |
Private Attributes | |
unsigned int | port_ |
std::string | proxy_ |
std::string | urlToGet_ |
Definition at line 8 of file SquidNet.h.
evf::SquidNet::SquidNet | ( | unsigned int | proxyport, |
std::string const & | url | ||
) |
virtual evf::SquidNet::~SquidNet | ( | ) | [inline, virtual] |
Definition at line 12 of file SquidNet.h.
{}
bool evf::SquidNet::check | ( | void | ) |
Definition at line 21 of file SquidNet.cc.
References error, NULL, proxy_, AlCaHLTBitMon_QueryRunRegistry::string, summarizeEdmComparisonLogfiles::success, urlToGet_, and evf::write_data().
Referenced by evf::FUEventProcessor::FUEventProcessor(), and evf::ParameterSetRetriever::ParameterSetRetriever().
{ bool retVal = true; CURL* han = curl_easy_init(); if(han==0) { XCEPT_RAISE(evf::Exception,"could not create handle for SquidNet fisher"); } char error[CURL_ERROR_SIZE]; std::string dummy; struct curl_slist *headers=NULL; /* init to NULL is important */ headers = curl_slist_append(headers, "Pragma:"); curl_easy_setopt(han, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(han, CURLOPT_PROXY, proxy_.c_str()); curl_easy_setopt(han, CURLOPT_URL, urlToGet_.c_str()); curl_easy_setopt(han, CURLOPT_WRITEFUNCTION, &write_data); curl_easy_setopt(han, CURLOPT_WRITEDATA, &dummy); curl_easy_setopt(han, CURLOPT_ERRORBUFFER, error); int success = curl_easy_perform(han); curl_slist_free_all(headers); /* free the header list */ curl_easy_cleanup(han); if(success != 0) retVal = false; return retVal; }
unsigned int evf::SquidNet::port_ [private] |
Definition at line 15 of file SquidNet.h.
Referenced by SquidNet().
std::string evf::SquidNet::proxy_ [private] |
Definition at line 16 of file SquidNet.h.
Referenced by check(), and SquidNet().
std::string evf::SquidNet::urlToGet_ [private] |
Definition at line 17 of file SquidNet.h.
Referenced by check().