CMS 3D CMS Logo

evf::SquidNet Class Reference

#include <EventFilter/Utilities/interface/SquidNet.h>

List of all members.

Public Member Functions

bool check ()
 SquidNet (unsigned int, std::string const &)
virtual ~SquidNet ()

Private Attributes

unsigned int port_
std::string proxy_
std::string urlToGet_


Detailed Description

Definition at line 8 of file SquidNet.h.


Constructor & Destructor Documentation

evf::SquidNet::SquidNet ( unsigned int  proxyport,
std::string const &  url 
)

Definition at line 15 of file SquidNet.cc.

References port_, and proxy_.

00015                                                                  : port_(proxyport), urlToGet_(url) 
00016   {
00017     std::ostringstream oproxy;
00018     oproxy << "localhost:" << port_;
00019     proxy_ = oproxy.str();
00020   }

virtual evf::SquidNet::~SquidNet (  )  [inline, virtual]

Definition at line 12 of file SquidNet.h.

00012 {}


Member Function Documentation

bool evf::SquidNet::check ( void   ) 

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   }


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:46:49 2009 for CMSSW by  doxygen 1.5.4