#include <EventFilter/Utilities/interface/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 21 of file SquidNet.cc.
References dummy, error, NULL, proxy_, urlToGet_, and evf::write_data().
Referenced by evf::FUEventProcessor::FUEventProcessor(), evf::ParameterSetRetriever::ParameterSetRetriever(), and evf::FUEventProcessor::scalers().
00021 { 00022 bool retVal = true; 00023 00024 CURL* han = curl_easy_init(); 00025 if(han==0) 00026 { 00027 XCEPT_RAISE(evf::Exception,"could not create handle for SquidNet fisher"); 00028 } 00029 char error[CURL_ERROR_SIZE]; 00030 std::string dummy; 00031 00032 struct curl_slist *headers=NULL; /* init to NULL is important */ 00033 00034 headers = curl_slist_append(headers, "Pragma:"); 00035 00036 curl_easy_setopt(han, CURLOPT_HTTPHEADER, headers); 00037 00038 curl_easy_setopt(han, CURLOPT_PROXY, proxy_.c_str()); 00039 00040 curl_easy_setopt(han, CURLOPT_URL, urlToGet_.c_str()); 00041 00042 curl_easy_setopt(han, CURLOPT_WRITEFUNCTION, &write_data); 00043 curl_easy_setopt(han, CURLOPT_WRITEDATA, &dummy); 00044 curl_easy_setopt(han, CURLOPT_ERRORBUFFER, error); 00045 int success = curl_easy_perform(han); 00046 00047 curl_slist_free_all(headers); /* free the header list */ 00048 00049 curl_easy_cleanup(han); 00050 if(success != 0) 00051 retVal = false; 00052 return retVal; 00053 }
unsigned int evf::SquidNet::port_ [private] |
std::string evf::SquidNet::proxy_ [private] |
std::string evf::SquidNet::urlToGet_ [private] |